Page 1 of 1

nls, couldn't achieve convergence

Posted: Mon Nov 07, 2016 5:31 am
by Gin
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!

Re: nls, couldn't achieve convergence

Posted: Tue Nov 08, 2016 3:13 pm
by Gin
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!

Re: nls, couldn't achieve convergence

Posted: Tue Nov 08, 2016 3:32 pm
by startz
I hit estimate again on NLS_RETURN_EUR and it converged. You might just want to try it manually a few times.

Re: nls, couldn't achieve convergence

Posted: Tue Nov 08, 2016 4:02 pm
by Gin
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!

Re: nls, couldn't achieve convergence

Posted: Wed Nov 09, 2016 6:44 am
by startz
It's always a good idea to specify starting values.