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!