ESTR modelling in a non linear System
Re: ESTR modelling in a non linear System
It sounds as if you're trying to do a univariate serial correlation test based upon a systems estimation. I'm not sure that will work properly, since the univariate residuals aren't orthogonal to its own derivatives; instead, it's a weighted combination of the bivariate residuals which are orthogonal to the derivatives.
In the context of a univariate NLLS, the LM test for serial correlation would be done by regressing the residuals on the lag of the residuals and the VECT[SERIES] that you get using the DERIVES option on NLLS.
In the context of a univariate NLLS, the LM test for serial correlation would be done by regressing the residuals on the lag of the residuals and the VECT[SERIES] that you get using the DERIVES option on NLLS.
Re: ESTR modelling in a non linear System
Thanks very much! Does that actually mean that I cannot test for autocorrelation in a nonlinear system? Or is it adequate to test for each of the two equations separately (I estimate two equations). I tried it for one equation (I could use the estimated values from the system as well)
statistics z
compute lamda1 = %mean,gamma1=2.0, lamda1 = %mean
compute scalef=1.0/sqrt(%variance)
dec vector abcd
nonlin mu0 mu1 alpha1 alpha2 gamma1 lamda1
frml transfct1 = 1-exp(-scalef^2*gamma1*(z(T-2)-lamda1)^2)
frml strgl1 x = mu0 + alpha1*(z(T-1)-lamda1)+ transfct1(T)*(mu1+alpha2*(z(T-1)-lamda1))
compute mu0=0,mu1=0,alpha2=0.5,alpha1=1
nlls(frml=strgl1,subiters=3000,robust,lwindow=neweywest,lags=6,derives=Vector) x gstart gend residuals
set k = residuals(t-1)
linreg residuals
# k VECTOR(2) VECTOR(3) VECTOR(4) VECTOR(5)
The problem is that autocorrelation actually seems to exist as the coefficient for the once lagged residuals is highly significant which also results in overall significance for the tests for higher order. The problem is that I cant get rid of this problem. Including x on the right hand side would mean that I have multicollinerity on the right hand side.
But iam also quite confused as I use the robust command and the newey west command combined with the lags=6 which in my understanding should account for possible autocorrelation. Is there any other possibility that I can handle with this problem when estimating the original system?
Ialso tried to get the residuals for the nonlinear system but it didint work. I used the following code
nlsystem(parmset=P,iters=2000,subiters=3000,robust,lwindow=neweywest,lags=4,derives=Vector) gstart gend strgl1 strgl2 residuals
statistics z
compute lamda1 = %mean,gamma1=2.0, lamda1 = %mean
compute scalef=1.0/sqrt(%variance)
dec vector abcd
nonlin mu0 mu1 alpha1 alpha2 gamma1 lamda1
frml transfct1 = 1-exp(-scalef^2*gamma1*(z(T-2)-lamda1)^2)
frml strgl1 x = mu0 + alpha1*(z(T-1)-lamda1)+ transfct1(T)*(mu1+alpha2*(z(T-1)-lamda1))
compute mu0=0,mu1=0,alpha2=0.5,alpha1=1
nlls(frml=strgl1,subiters=3000,robust,lwindow=neweywest,lags=6,derives=Vector) x gstart gend residuals
set k = residuals(t-1)
linreg residuals
# k VECTOR(2) VECTOR(3) VECTOR(4) VECTOR(5)
The problem is that autocorrelation actually seems to exist as the coefficient for the once lagged residuals is highly significant which also results in overall significance for the tests for higher order. The problem is that I cant get rid of this problem. Including x on the right hand side would mean that I have multicollinerity on the right hand side.
But iam also quite confused as I use the robust command and the newey west command combined with the lags=6 which in my understanding should account for possible autocorrelation. Is there any other possibility that I can handle with this problem when estimating the original system?
Ialso tried to get the residuals for the nonlinear system but it didint work. I used the following code
nlsystem(parmset=P,iters=2000,subiters=3000,robust,lwindow=neweywest,lags=4,derives=Vector) gstart gend strgl1 strgl2 residuals
Re: ESTR modelling in a non linear System
The appropriate LM test would beGilbril wrote:Thanks very much! Does that actually mean that I cannot test for autocorrelation in a nonlinear system? Or is it adequate to test for each of the two equations separately (I estimate two equations). I tried it for one equation (I could use the estimated values from the system as well)
set k = residuals(t-1)
linreg residuals
# k VECTOR(2) VECTOR(3) VECTOR(4) VECTOR(5)
linreg residuals
# k vector
You're dropping the 1 (derivative wrt mu0) and the derivative with respect to lamda1. That may not make a qualitative change to the result, but at least you'll be doing the test correctly. There would be a system variant of the LM test for serial correlation, but that would be a bit complicated. You can always use something simple like a Q test. What the asymptotic distribution of that would be isn't known, since this isn't strictly an ARMA model, but chi-squared with # of correlations - 2 degrees of freedom is probably close enough at least for basic diagnostics. If your model is supposed to be leaving serial uncorrelated errors and it's not, then perhaps the model doesn't have rich enough dynamics. If you look at the TAR literature, the usual practice is to start with an AR model that takes care of the autocorrelation, add the threshold effect, then eliminate redundant coefficients.
Re: ESTR modelling in a non linear System
Dear Tom,
thanks for your help. I guess I will just carry on with the LM Tests for each equation because this should also be ok for basic diagnostics. However, Iam still wondering why
nlsystem(parmset=P,iters=2000,subiters=3000,robust,lwindow=neweywest,lags=4,derives=Vector) gstart gend strgl1 strgl2 residuals
isnt working for getting the residuals even when I put resids behind the compute command. But in the Ende I dont really need this command when I stick with the test for the single equations
Anyway, I just wanted to say that you really helped me a lot with my modell and I really appreciate that. Expecially since you also answered questions which refered to the model and not to the code! Thanks very much
thanks for your help. I guess I will just carry on with the LM Tests for each equation because this should also be ok for basic diagnostics. However, Iam still wondering why
nlsystem(parmset=P,iters=2000,subiters=3000,robust,lwindow=neweywest,lags=4,derives=Vector) gstart gend strgl1 strgl2 residuals
isnt working for getting the residuals even when I put resids behind the compute command. But in the Ende I dont really need this command when I stick with the test for the single equations
Anyway, I just wanted to say that you really helped me a lot with my modell and I really appreciate that. Expecially since you also answered questions which refered to the model and not to the code! Thanks very much