nls, couldn't achieve convergence

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

Gin
Posts: 22
Joined: Wed Oct 19, 2016 10:26 am

nls, couldn't achieve convergence

Postby Gin » Mon Nov 07, 2016 5:31 am

Hi all,

I have written a loop to perform three NLS regression with the same setting . For two out of three dependent variables, it worked out just fine. However, eviews could achieve convergence for one of the equation and the p-values are one for all of the coefficients. This looks very odd to me.

Here's my code

Code: Select all


coef(1) const               ''' declare constant
coef(14) beta               ''' declare coefficients for each macro surprises, there are 14 dependent variables
coef(2) gamma               ''' declare coefficients for time dummies. effects of the time dummies are assumed to be constant over subsample

''' store name of variables in a temporary string
%prices = "return_sp500 return_eur return_yen"

%macro_surp = macro_surp.@members

for !j = 1 to @wcount(%prices)
   %p = @word(%prices, !j)
   %spec = %p + "= const(1)"

      for !i = 1 to @wcount(%macro_surp)
         %var = @word(%macro_surp, !i)
         %spec = %spec + " + beta" + "(" + @str(!i) + ")" + "*" + %var + "*" +  "(1 + gamma(1)*date_based+ gamma(2)*state_based)"
      next

   equation nls_{%p}.ls(cov = huber) {%spec}
   show nls_{%p}
next


The result is problematic for nls_return_eur. I have attached my workfile. Would be great if someone can take a look at this.

I would appreciate any suggestions.

Thanks!

Gin
Posts: 22
Joined: Wed Oct 19, 2016 10:26 am

Re: nls, couldn't achieve convergence

Postby Gin » Tue Nov 08, 2016 3:13 pm

I suspect that the error results from my code rather from the data.. The estimation result look like follow

Can anyone give me a hint? Thanks!
Attachments
nls_eur.png
nls_eur.png (53 KiB) Viewed 4075 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: nls, couldn't achieve convergence

Postby startz » Tue Nov 08, 2016 3:32 pm

I hit estimate again on NLS_RETURN_EUR and it converged. You might just want to try it manually a few times.

Gin
Posts: 22
Joined: Wed Oct 19, 2016 10:26 am

Re: nls, couldn't achieve convergence

Postby Gin » Tue Nov 08, 2016 4:02 pm

Hi startz,

thanks for taking a look at my workfile. I still can not get a reasonable result. It always says that convergence is not achieved after 500 (or more iterations). Do you think I need to specify starting values in this case?

Thanks!

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: nls, couldn't achieve convergence

Postby startz » Wed Nov 09, 2016 6:44 am

It's always a good idea to specify starting values.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 18 guests