File Exchange

image thumbnail

Variance Ratio Test

version (1.21 KB) by Alexandros Leontitsis
Calculates the Variance Ratio Test


Updated 16 Dec 2004

No License

Calculates the Variance Ratio Test of a time series, with or without the heteroskedasticity correction.

Cite As

Alexandros Leontitsis (2021). Variance Ratio Test (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)

Christe Antoine

Holger Amort

Should be:
% q values must be between 2 and n/2-1
if length((find(q<2 | q>=n/2)))>0
error('q values must be between 2 and n/2-1');


Jaime Zamora


This script does not seem exactly the same as Lo and Mackinlay.

hojatallah goudarzi

thanks a lot

Simon Zhang

sab mao

thank you


Martin Williams

This is a great script! I'd never used Matlab before! I Didnt even know it existed buti managed to sus out how to use this script :) Id give you a tip! two problems! The first is that there isnt a percentage sign infront of the the top Vr bit and brackets! The second is that if you run the whole script you get that irritating nargin thing. Don't worry though, just copy and paste from the point where is says...

%calculate the mean

Nick Laxton

Hi - the only downside to this is that whilst q can be a vector, the time series cannot be a matrix in the sense of a set of time series. I have done the opposite to you by making the time series a matrix if required but computing for only scalar q.

However I was pleased enough to use your function as a consistency check to mine...


MATLAB Release Compatibility
Created with R13
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!