Products & Services Solutions Academia Support User Community Company

Learn more about Econometrics Toolbox   

vratiotest - Variance ratio test for random walk

Syntax

h = vratiotest(y)
h = vratiotest(y,'ParameterName',ParameterValue,...)
[h,pValue] = vratiotest(...)
[h,pValue,stat] = vratiotest(...)
[h,pValue,stat,cValue] = vratiotest(...)
[h,pValue,stat,cValue,ratio] = vratiotest(...)

Description

h = vratiotest(y) assesses the null hypothesis of a random walk in a univariate time series y.

h = vratiotest(y,'ParameterName',ParameterValue,...) accepts optional inputs as one or more comma-separated parameter-value pairs. 'ParameterName' is the name of the parameter inside single quotation marks. ParameterValue is the value corresponding to 'ParameterName'. Specify parameter-value pairs in any order; names are case-insensitive. Perform multiple tests by passing a vector value for any parameter. Multiple tests yield vector results.

[h,pValue] = vratiotest(...) returns p-values of the test statistics.

[h,pValue,stat] = vratiotest(...) returns the test statistics.

[h,pValue,stat,cValue] = vratiotest(...) returns critical values for the tests.

[h,pValue,stat,cValue,ratio] = vratiotest(...) returns a vector of ratios.

Inputs

y

Vector of time-series data. The last element is the most recent observation. The test ignores NaN values, which indicate missing entries.

The input series y is in levels. To convert a return series r to levels, define y(1) and let y = cumsum([y(1);r]).

Parameter/Value Pairs

'alpha'

Scalar or vector of nominal significance levels for the tests. Set values between 0 and 1.

The test is two-tailed, so vratiotest rejects the random-walk null when the test statistic is outside of the critical interval [-cValue,cValue]. Each tail outside of the critical interval has probability alpha/2.

Default: 0.05

'IID'

Scalar or vector of Boolean values indicating whether to assume independent identically distributed (IID) innovations.

To strengthen the null model and assume that the e(t) are independent and identically distributed (IID), set 'IID' to true.

The IID assumption is often unreasonable for long-term macroeconomic or financial price series. Rejection of the random-walk null due to heteroskedasticity is not interesting for these cases.

Default: false

'period'

Scalar or vector of integers greater than one and less than half the number of observations in y, indicating the period q used to create overlapping return horizons for the variance ratio.

When the period q has the default value of 2, the first-order autocorrelation of the returns is asymptotically equal to ratio1.

The test finds the largest integer n such that n*q ≤ T1, where T is the sample size. It then discards the final (T1)–n*q observations. To include these final observations, discard the initial (T1)–n*q observations in y before running the test.

Default: 2

Outputs

h

Vector of Boolean decisions for the tests, with length equal to the number of tests. Values of h equal to 1 indicate rejection of the random-walk null in favor of the alternative. Values of h equal to 0 indicate a failure to reject the random-walk null.

pValue

Vector of p-values of the test statistics, with length equal to the number of tests. Values are standard normal probabilities.

stat

Vector of test statistics, with length equal to the number of tests. Statistics are asymptotically standard normal.

cValue

Vector of critical values for the tests, with length equal to the number of tests. Values are for standard normal probabilities.

ratio

Vector of variance ratios, with length equal to the number of tests. Each ratio is the ratio of:

  • The variance of the q-fold overlapping return horizon

  • q times the variance of the return series

For a random walk, these ratios are asymptotically equal to one. For a mean-reverting series, the ratios are less than one. For a mean-averting series, the ratios are greater than one.

Definitions

The variance ratio test assesses the null hypothesis that a univariate time series y is a random walk. The null model is

y(t) = c + y(t–1) + e(t),

where c is a drift constant and e(t) are uncorrelated innovations with zero mean.

Examples

Test US equity index data for a random walk using various step sizes, with and without the IID assumption:

load indexdata
data = IndexData.US; % Daily S&P 500, 04-27-93 to 07-14-03
y = log(data);
plot(diff(y)) % Return series, showing heteroskedasticity
q = [2 4 8 2 4 8];
flag = logical([1 1 1 0 0 0]);
[h,pValue,stat,cValue,ratio] = ...
        vratiotest(y,'period',q,'IID',flag)
rho1 = ratio(1)-1 % First-order autocorrelation of returns

The commands yield the following plot and output:

h =
     0     0     1     0     0     0

pValue =
    0.5670    0.3307    0.0309    0.7004    0.5079    0.1303

stat =
    0.5724   -0.9727   -2.1579    0.3847   -0.6621   -1.5128

cValue =
    1.9600    1.9600    1.9600    1.9600    1.9600    1.9600

ratio =
    1.0111    0.9647    0.8763    1.0111    0.9647    0.8763

rho1 =
    0.0111

The h values mean the test fails to reject the random-walk null at the default 5% significance level, except in the case where 'period' is 8 and 'IID' is true. The rejection is likely due to the heteroskedasticity.

Algorithm

The vratiotest test statistics are based on a ratio of variance estimates of returns r(t) = y(t)–y(t–1) and period q return horizons r(t) + ... + r(tq+1). Overlapping horizons increase the efficiency of the estimator and add power to the test. Under either null, uncorrelated innovations e(t) imply that the period q variance is asymptotically equal to q times the period 1 variance. The variance of the ratio, however, depends on the degree of heteroskedasticity, and, therefore, on the null.

Rejection of the null due to dependence of the innovations does not imply that the e(t) are correlated. Dependence allows that nonlinear functions of the e(t) are correlated, even when the e(t) are not. For example, it can hold that Cov[e(t),e(tk)] = 0 for all k ≠ 0, while Cov[e(t)2,e(tk)2] ≠ 0 for some k ≠ 0.

Cecchetti and Lam [2] show that sequential testing using multiple values of q results in small-sample size distortions beyond those that result from the asymptotic approximation of critical values.

References

[1] Campbell, J. Y., A. W. Lo, and A. C. MacKinlay. Chapter 12. "The Econometrics of Financial Markets." Nonlinearities in Financial Data. Princeton, NJ: Princeton University Press, 1997.

[2] Cecchetti, S. G., and P. S. Lam. "Variance-Ratio Tests: Small-Sample Properties with an Application to International Output Data." Journal of Business and Economic Statistics. Vol. 12, 1994, pp. 177–186.

[3] Cochrane, J. "How Big is the Random Walk in GNP?" Journal of Political Economy. Vol. 96, 1988, pp. 893–920.

[4] Faust, J. "When Are Variance Ratio Tests for Serial Dependence Optimal?" Econometrica. Vol. 60, 1992, pp. 1215–1226.

[5] Lo, A. W., and A. C. MacKinlay. "Stock Market Prices Do Not Follow Random Walks: Evidence from a Simple Specification Test." Review of Financial Studies. Vol. 1, 1988, pp. 41–66.

[6] Lo, A. W., and A. C. MacKinlay. "The Size and Power of the Variance Ratio Test." Journal of Econometrics. Vol. 40, 1989, pp. 203–238.

[7] Lo, A. W., and A. C. MacKinlay. A Non-Random Walk Down Wall St. Princeton, NJ: Princeton University Press, 2001.

See Also

adftest | kpsstest | pptest

How To

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS