long run variance of a stationary series
LR = longrun_variance(X,kern,bandwitch)
* X = vector of observations
* kern =
- 'qs' for Quadratic Spectral (Defaut)
- 'b' for Bartlett
* bandwitch =
-'n' (Default) for the Newey West (1994)'s non parametric bandwitch parameter
-'a' for the Andrews (1991) automatic bandwitch parameter selection with AR(1) structure
* LR a results tlist with:
- LR('meth') = 'lr variance'
- LR('omega') = Long run variance of X
- LR('kernel') = kernel function
- LR('bandwitch') = Method to fix the bandwitch parameter
- LR('h') = Value of bandwitch parameter
load(GROCERDIR+'/data/bdhenderic.dat') l=longrun_variance(series(delts(lm1)),'qs','n') h=l('h') // provides the Standard Newey-West estimate of the long-run variance with a floor (4*(T/100)^(2/25)) window width (equivalent to newey_west(x,(4*(T/100)^(2/25)))) LRV_func = longrun_variance(residual(:,i),kern,bandwitch) //example taken from function Moon_Perron | ![]() | ![]() |