
ROBUST INFERENCE FOR DIFFERENCES OF VARIANCES
=============================================

Michael Wolf
University of Zurich
September 2026


This MATLAB package provides robust inference for differences of variances.
It supersedes all previous versions of the package.

The package is designed for inference on the difference of two variances.
Following Ledoit and Wolf (2011), inference is carried out using the
difference of log sample variances. The log transformation improves
finite-sample performance.


MAIN ROUTINES
=============

HAC_Variance
------------

Carries out HAC inference for the difference of log variances.

The routine provides a HAC standard error and p-value, and their
prewhitened counterparts. Both the Parzen-Gallant and
Quadratic-Spectral kernels are available.


bootstrap_Variance
------------------

Carries out studentized circular block bootstrap inference for the
difference of log variances.

The routine returns the bootstrap p-value, the estimated difference of
log variances, the original test statistic, and the block size.

If the block size is not supplied by the user, it is selected by
blockSizeCalibrate_Variance.


blockSizeCalibrate_Variance
---------------------------

Selects the block size for the circular block bootstrap using the
calibration procedure implemented in the package.

The default candidate block sizes are

    bVec = [1,2,4,6,8,10]'

the default number of bootstrap replications used for each test is

    M = 499

and the default number of calibration samples is

    K = 2000.

The calibration is computationally more demanding than the other
routines and may take several minutes. We recommend running this
function separately and then supplying the selected block size to
bootstrap_Variance.

Users should inspect the estimated rejection probabilities rather than
rely mechanically on the selected block size. In particular, if the
selected block size is at the boundary of bVec and the rejection
probabilities are still moving toward the nominal significance level,
the candidate set should be extended and the calibration rerun.


logVarianceDiff
---------------

Computes the difference of log sample variances.

This routine is useful when the variance inference in this package is
embedded in a multiple-testing procedure, since it provides the
estimated difference needed to construct the original studentized
test statistic.


bootStats_Variance
------------------

For a given circular block bootstrap sample and block size, computes

    DeltaHatStar    the bootstrap difference of log sample variances

and

    seStar          the corresponding bootstrap standard error.

This routine is useful when the variance inference in this package is
embedded in a multiple-testing procedure. In particular,
logVarianceDiff, HACnoOut_Variance, and bootStats_Variance provide the
low-level ingredients needed to construct original and bootstrap
studentized statistics for a collection of variance differences.
These quantities can then be used with higher-level multiple-testing
procedures such as the Romano-Wolf stepdown methodology; see Romano
and Wolf (2016).

To preserve the dependence across hypotheses, bootstrap samples must
be generated jointly across all assets or strategies involved. The
function cbbSequence can be used to generate a common bootstrap index
sequence, which is then used to re-index the rows of the original data
matrix.

Users interested in bootstrap inference for a single difference of
variances do not need to call bootStats_Variance directly;
bootstrap_Variance handles these calculations internally.


SUPPORTING ROUTINES
===================

The package contains a number of supporting routines used internally
for HAC estimation, prewhitening, circular and stationary block
bootstrap sampling, block-size calibration, and computation of
differences of log variances.

Users interested only in standard inference will normally need to call
only HAC_Variance, bootstrap_Variance, and, if desired,
blockSizeCalibrate_Variance.

Users implementing their own bootstrap or multiple-testing procedures
may additionally find logVarianceDiff, HACnoOut_Variance, and
bootStats_Variance useful.


DATA
====

The input return matrix for the main inference routines has two columns,
one for each return series.

For illustration, the file retSharpe.mat is included with the package.
It contains the data sets used in the two empirical applications of
Ledoit and Wolf (2008). These data are included here as example data on
which the variance-inference routines can be run.


REFERENCES
==========

Ledoit, O. and Wolf, M. (2008).
Robust performance hypothesis testing with the Sharpe ratio.
Journal of Empirical Finance 15, 850-859.

Ledoit, O. and Wolf, M. (2011).
Robust performances hypothesis testing with the variance.
Wilmott Magazine, September, 86-89.

Romano, J. P. and Wolf, M. (2016).
Efficient computation of adjusted p-values for resampling-based stepdown
multiple testing.
Statistics & Probability Letters 113, 38-40.

