Name
newey_west — Newey_West variance estimator
CALLING SEQUENCE
nw=newey_west(resid,l)
PARAMETERS
- Input
x = input matrix or vector, (nobs x k)
l = order of lag (optional)
- Output
nw = matrix (or vector) of lags (nobs x k)
DESCRIPTION
Performs the Newey_West variance estimator; if no truncation lag (l) is provided by the user, then it is fixed at floor(5*nobs^0.25).if l <= 0, nw = [] is returned.
EXAMPLE
load(GROCERDIR+'data/bdhenderic.dat')
r=ols('lm1','const','trend(1,length(series(lm1)))')
sigma1=newey_west(r('resid'),10)
sigma2=newey_west(r('resid'))
// default length used (here it amounts to 16)