hi, i want to estimate some equations with e-views that i know might be a cuadratic regression, so my question is: is it possible to estimate non linear regressions with e-views? how?
thanks a lot.
Jasil
non linear regressions
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: non linear regressions
Yes. You simply enter your non-linear equation in the estimation box. For more details, see the "Nonlinear Least Squares" section of Chapter 19 of User Guide II (EViews 7 - for other versions, simply look up nonlinear in the index).
Re: non linear regressions
Hi all,
My question is slightly more technical but still on nls estimation.
On page 633 of users guide II (eviews 6) one reads:
"For general nonlinear models (nonlinear least squares, ARCH and GARCH, nonlinear system
estimators, GMM, State Space), EViews provides two first derivative methods: Gauss-Newton/
BHHH or Marquardt."
However, while for arch and garch and for system I have found the way to change the algorithm from Marquardt to BHHH, I have not found a way to do the same in nls estimation of a nonlinear equation...does anybody know how to do that? My short-cut to the problem so far has been to write the equation in a (one equation) system and estimate it by fiml with BHHH. However, I am not sure I am doing the right thing because what I would like to do is a simple nls estimation via BHHH and not a fiml estimation ... I AM PUZZLED!
I know that maximum likelihood and nls should be equivalent asymptotically but even if my dataset is large I am not sure I can use them interchangeably, Can somebody help?
THANKS SOOOOOOOOO MUCH!
My question is slightly more technical but still on nls estimation.
On page 633 of users guide II (eviews 6) one reads:
"For general nonlinear models (nonlinear least squares, ARCH and GARCH, nonlinear system
estimators, GMM, State Space), EViews provides two first derivative methods: Gauss-Newton/
BHHH or Marquardt."
However, while for arch and garch and for system I have found the way to change the algorithm from Marquardt to BHHH, I have not found a way to do the same in nls estimation of a nonlinear equation...does anybody know how to do that? My short-cut to the problem so far has been to write the equation in a (one equation) system and estimate it by fiml with BHHH. However, I am not sure I am doing the right thing because what I would like to do is a simple nls estimation via BHHH and not a fiml estimation ... I AM PUZZLED!
THANKS SOOOOOOOOO MUCH!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: non linear regressions
The manual isn't very accurate on this. As you have found, we don't appear to allow ordinary Gauss-Newton for nonlinear least squares. It appears that the sentence was trying to describe several estimators at the same time and made a bit of a hash of it all.
As to the FIML/NLLS issue, we'd have to have a closer look at your specification to see what might be going on. It is quite possible that the specifications that you are providing aren't equivalent...If you'd like to send workfiles we can take a look.
I am, however, curious as to why you are set on estimating with Gauss-Newton. In principle, Marquardt should perform better than Gauss-Newton and, assuming well-behaved objectives, the two should produce the same results for coefficients and standard errors.
As to the FIML/NLLS issue, we'd have to have a closer look at your specification to see what might be going on. It is quite possible that the specifications that you are providing aren't equivalent...If you'd like to send workfiles we can take a look.
I am, however, curious as to why you are set on estimating with Gauss-Newton. In principle, Marquardt should perform better than Gauss-Newton and, assuming well-behaved objectives, the two should produce the same results for coefficients and standard errors.
Re: non linear regressions
Dear Glenn,
Thx so much 4 yr quick reply (it's also conforting to see that sometimes also manuals can be wrong/confusing
not only our papers!)
The issue is that I really need what's the different performance of the two algorithms because I am doing a monte carlo study on a particular type of models and I need to evaluate all the possible scenarios.
As of the NLS/FIML issue I am still puzzled myself..the specification I am using is of the following type:
x=phi1(1)+phi1(2)*s(-1)+phi1(3)*y+phi1(4)*x(-1)+phi1(5)*y(-1)+(phi2(1)+phi2(2)*s(-1)+phi2(3)*y+phi2(4)*x(-1)+phi2(5)*y(-1))*@logit(-thr(1)/scalef*(s(-1)+thr(2))*(s(-1)+thr(3)))
Indeed I get exactly the same parameters value results if I run it as NLS equation or as a FIML(maquardt) system, but not when I do fiml BHHH (which makes perfeclty sense to me)...teoretically do u think I should use the logl object insted of fiml since the equation is quite complicated (and the obj function is not at all well behaved)? or do u think in this case fiml is equivalent to nls?
Anything will be helpful**thanks again
Thx so much 4 yr quick reply (it's also conforting to see that sometimes also manuals can be wrong/confusing
The issue is that I really need what's the different performance of the two algorithms because I am doing a monte carlo study on a particular type of models and I need to evaluate all the possible scenarios.
As of the NLS/FIML issue I am still puzzled myself..the specification I am using is of the following type:
x=phi1(1)+phi1(2)*s(-1)+phi1(3)*y+phi1(4)*x(-1)+phi1(5)*y(-1)+(phi2(1)+phi2(2)*s(-1)+phi2(3)*y+phi2(4)*x(-1)+phi2(5)*y(-1))*@logit(-thr(1)/scalef*(s(-1)+thr(2))*(s(-1)+thr(3)))
Indeed I get exactly the same parameters value results if I run it as NLS equation or as a FIML(maquardt) system, but not when I do fiml BHHH (which makes perfeclty sense to me)...teoretically do u think I should use the logl object insted of fiml since the equation is quite complicated (and the obj function is not at all well behaved)? or do u think in this case fiml is equivalent to nls?
Anything will be helpful**thanks again
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: non linear regressions
So what I'm getting from the last message is that you're getting the same parameters using NLS and FIML with Marquardt? But not using FIML with BHHH?
What is your convergence tolerance and what do your gradients look like at the solution? Do the standard errors look reasonable? I have a suspicion that this thing is barely identified/close to singular...
What is your convergence tolerance and what do your gradients look like at the solution? Do the standard errors look reasonable? I have a suspicion that this thing is barely identified/close to singular...
Re: non linear regressions
Dear Glenn,
I think you understood correctly, and indeed sometimes in my estimation ONLY WITH BHHH I get the message of near singular matrix. With maquardt i don't have any problems and also the standard error are reasonable ....
The fact is that from the theoretical point of view, my equation should be identified, hence I don't really understand what's going on...maybe it helps if I show you my results, this is what I get with ML estimation and Marquardt [this time I programmed the logl just 2 be sure]:
LogL: STECM1
Method: Maximum Likelihood (Marquardt)
Date: 03/22/11 Time: 11:14
Sample: 1981M03 1995M12
Included observations: 178
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: PHI1(1)=0.00000, PHI1(2)=0.12000, PHI1(3)=0.00000,
PHI1(4)=0.00000, PHI1(5)=0.00000, PHI2(1)=0.00000, PHI2(2)=0.0000
0, PHI2(3)=0.00000, PHI2(4)=0.00000, PHI2(5)=0.00000,
THR(1)=0.00000, THR(2)=0.00000, THR(3)=0.00000, SIG(1)=1.00000
Convergence achieved after 182 iterations
Coefficient Std. Error z-Statistic Prob.
PHI1(1) -0.032232 0.032332 -0.996890 0.3188
PHI1(2) 0.121556 0.079300 1.532873 0.1253
PHI1(3) 0.903186 0.031529 28.64639 0.0000
PHI1(4) -0.117272 0.062186 -1.885836 0.0593
PHI1(5) 0.107679 0.081764 1.316938 0.1879
PHI2(1) 0.324011 0.283303 1.143689 0.2528
PHI2(2) 0.424452 0.402353 1.054923 0.2915
PHI2(3) 0.148642 0.324679 0.457810 0.6471
PHI2(4) 0.255989 0.709054 0.361029 0.7181
PHI2(5) -0.736272 0.798837 -0.921680 0.3567
THR(1) -2.783455 7.178201 -0.387765 0.6982
THR(2) 0.401488 0.219515 1.828978 0.0674
THR(3) -1.251648 0.285821 -4.379140 0.0000
SIG(1) 0.217028 0.007010 30.95762 0.0000
Log likelihood 19.36329 Akaike info criterion -0.060262
Avg. log likelihood 0.108783 Schwarz criterion 0.189991
Number of Coefs. 14 Hannan-Quinn criter. 0.041222
----------------------------------------------------------------------------------------------------
This is what I get with BHHH, same data and same starting values
LogL: STECM2
Method: Maximum Likelihood (BHHH)
Date: 03/22/11 Time: 11:23
Sample: 1981M03 1995M12
Included observations: 178
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: PHI1(1)=0.00000, PHI1(2)=0.12000, PHI1(3)=0.00000,
PHI1(4)=0.00000, PHI1(5)=0.00000, PHI2(1)=0.00000, PHI2(2)=0.0000
0, PHI2(3)=0.00000, PHI2(4)=0.00000, PHI2(5)=0.00000,
THR(1)=0.00000, THR(2)=0.00000, THR(3)=0.00000, SIG(1)=1.00000
Convergence achieved after 5 iterations
WARNING: Singular covariance - coefficients are not unique
Coefficient Std. Error z-Statistic Prob.
PHI1(1) 99.84838 NA NA NA
PHI1(2) 131.6366 NA NA NA
PHI1(3) -141.8230 NA NA NA
PHI1(4) 31.42715 NA NA NA
PHI1(5) -229.1637 NA NA NA
PHI2(1) -199.7470 NA NA NA
PHI2(2) -262.9902 NA NA NA
PHI2(3) 285.4079 NA NA NA
PHI2(4) -62.66980 NA NA NA
PHI2(5) 458.1384 NA NA NA
THR(1) 0.000418 NA NA NA
THR(2) 1596.748 NA NA NA
THR(3) -1597.065 NA NA NA
SIG(1) 0.202966 NA NA NA
Log likelihood -8.985118 Akaike info criterion 0.258260
Avg. log likelihood -0.050478 Schwarz criterion 0.508512
Number of Coefs. 14 Hannan-Quinn criter. 0.359744
------------------------------------------------------------------------------------
Clearly I cannot even see the gradients for the BHHH....
How can the same model be identified with one algorithm and not with another? maybe in Eviews you use a somewhat different notion for "being identified" ?
Thanks again so much
I think you understood correctly, and indeed sometimes in my estimation ONLY WITH BHHH I get the message of near singular matrix. With maquardt i don't have any problems and also the standard error are reasonable ....
The fact is that from the theoretical point of view, my equation should be identified, hence I don't really understand what's going on...maybe it helps if I show you my results, this is what I get with ML estimation and Marquardt [this time I programmed the logl just 2 be sure]:
LogL: STECM1
Method: Maximum Likelihood (Marquardt)
Date: 03/22/11 Time: 11:14
Sample: 1981M03 1995M12
Included observations: 178
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: PHI1(1)=0.00000, PHI1(2)=0.12000, PHI1(3)=0.00000,
PHI1(4)=0.00000, PHI1(5)=0.00000, PHI2(1)=0.00000, PHI2(2)=0.0000
0, PHI2(3)=0.00000, PHI2(4)=0.00000, PHI2(5)=0.00000,
THR(1)=0.00000, THR(2)=0.00000, THR(3)=0.00000, SIG(1)=1.00000
Convergence achieved after 182 iterations
Coefficient Std. Error z-Statistic Prob.
PHI1(1) -0.032232 0.032332 -0.996890 0.3188
PHI1(2) 0.121556 0.079300 1.532873 0.1253
PHI1(3) 0.903186 0.031529 28.64639 0.0000
PHI1(4) -0.117272 0.062186 -1.885836 0.0593
PHI1(5) 0.107679 0.081764 1.316938 0.1879
PHI2(1) 0.324011 0.283303 1.143689 0.2528
PHI2(2) 0.424452 0.402353 1.054923 0.2915
PHI2(3) 0.148642 0.324679 0.457810 0.6471
PHI2(4) 0.255989 0.709054 0.361029 0.7181
PHI2(5) -0.736272 0.798837 -0.921680 0.3567
THR(1) -2.783455 7.178201 -0.387765 0.6982
THR(2) 0.401488 0.219515 1.828978 0.0674
THR(3) -1.251648 0.285821 -4.379140 0.0000
SIG(1) 0.217028 0.007010 30.95762 0.0000
Log likelihood 19.36329 Akaike info criterion -0.060262
Avg. log likelihood 0.108783 Schwarz criterion 0.189991
Number of Coefs. 14 Hannan-Quinn criter. 0.041222
----------------------------------------------------------------------------------------------------
This is what I get with BHHH, same data and same starting values
LogL: STECM2
Method: Maximum Likelihood (BHHH)
Date: 03/22/11 Time: 11:23
Sample: 1981M03 1995M12
Included observations: 178
Evaluation order: By observation
Estimation settings: tol= 1.0e-05, derivs=accurate numeric
Initial Values: PHI1(1)=0.00000, PHI1(2)=0.12000, PHI1(3)=0.00000,
PHI1(4)=0.00000, PHI1(5)=0.00000, PHI2(1)=0.00000, PHI2(2)=0.0000
0, PHI2(3)=0.00000, PHI2(4)=0.00000, PHI2(5)=0.00000,
THR(1)=0.00000, THR(2)=0.00000, THR(3)=0.00000, SIG(1)=1.00000
Convergence achieved after 5 iterations
WARNING: Singular covariance - coefficients are not unique
Coefficient Std. Error z-Statistic Prob.
PHI1(1) 99.84838 NA NA NA
PHI1(2) 131.6366 NA NA NA
PHI1(3) -141.8230 NA NA NA
PHI1(4) 31.42715 NA NA NA
PHI1(5) -229.1637 NA NA NA
PHI2(1) -199.7470 NA NA NA
PHI2(2) -262.9902 NA NA NA
PHI2(3) 285.4079 NA NA NA
PHI2(4) -62.66980 NA NA NA
PHI2(5) 458.1384 NA NA NA
THR(1) 0.000418 NA NA NA
THR(2) 1596.748 NA NA NA
THR(3) -1597.065 NA NA NA
SIG(1) 0.202966 NA NA NA
Log likelihood -8.985118 Akaike info criterion 0.258260
Avg. log likelihood -0.050478 Schwarz criterion 0.508512
Number of Coefs. 14 Hannan-Quinn criter. 0.359744
------------------------------------------------------------------------------------
Clearly I cannot even see the gradients for the BHHH....
How can the same model be identified with one algorithm and not with another? maybe in Eviews you use a somewhat different notion for "being identified" ?
Thanks again so much
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: non linear regressions
What's appears to be going on is that your starting values are bad. Marquardt, with its diagonal adjustment, does a pretty good job getting out of this region. BHHH is moving in a different direction and stalling in a region where the likelihood is flat.
Since your Marquardt is finding a reasonable solution it doesn't appear to be an identification issue but rather the common one with nonlinear algorithms where starting values matter. Starting your BHHH estimation at values closer to the Marquardt solution should solve the problem.
Since your Marquardt is finding a reasonable solution it doesn't appear to be an identification issue but rather the common one with nonlinear algorithms where starting values matter. Starting your BHHH estimation at values closer to the Marquardt solution should solve the problem.
Last edited by EViews Glenn on Wed Mar 23, 2011 11:29 am, edited 1 time in total.
Re: non linear regressions
That makes perfectly sense!
thanks for all your clarifications Glenn**
thanks for all your clarifications Glenn**
Who is online
Users browsing this forum: No registered users and 2 guests
