Defining derivatives and constrains?

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

EViews Matt
EViews Developer
Posts: 302
Joined: Thu Apr 25, 2013 7:48 pm

Re: Defining derivatives and constrains?

Postby EViews Matt » Thu Oct 18, 2018 9:59 am

Hello,

As startz correctly points out, expressing your equation as a list of terms that include coefficients, e.g., w c(1) (@exp(c(2)))*(1/x) (y/x) (z/x), doesn't do what you think it does. Putting the reason aside for a moment, that's why startz recommended that you express the equation as an explicit formula, i.e., w = c(1) + (@exp(c(2)))*(1/x) + (y/x) + (z/x). The @exp(c(2)) subexpression is one way to keep the coefficient of 1/x non-negative, but you can also try c(2)^2 instead. You may also find it useful to examine the graphs of 1/x and w-y/x-z/x to help understand the results of this regression.

Simplifier12
Posts: 18
Joined: Tue Sep 18, 2018 8:45 pm

Re: Defining derivatives and constrains?

Postby Simplifier12 » Thu Oct 18, 2018 8:02 pm

EViews Matt wrote:Hello,

As startz correctly points out, expressing your equation as a list of terms that include coefficients, e.g., w c(1) (@exp(c(2)))*(1/x) (y/x) (z/x), doesn't do what you think it does. Putting the reason aside for a moment, that's why startz recommended that you express the equation as an explicit formula, i.e., w = c(1) + (@exp(c(2)))*(1/x) + (y/x) + (z/x). The @exp(c(2)) subexpression is one way to keep the coefficient of 1/x non-negative, but you can also try c(2)^2 instead. You may also find it useful to examine the graphs of 1/x and w-y/x-z/x to help understand the results of this regression.


Hello Matt,

Thanks very much for getting back to me with your helpful tips. I tried the explicit formula w = c(1) + (@exp(c(2)))*(1/x) + (y/x) + (z/x). Though the @exp(c2) did not appear in the results table, I got no values for standard error, t-statistic and probability. Also the table shows failure notification for non-zero gradient as you can see below.
Image

I also tried the c(2)^2 hack instead of the @exp(c2). Though the results table notifies of a failure for non-zero gradient, I've got values for standard error, t-statistic and probability fortunately, which is unlike the previous results. But still the coefficient for c(2) is reported negative.
Image

Any thoughts or reckons would be much appreciated.
Thanks.
Last edited by Simplifier12 on Thu Oct 18, 2018 8:14 pm, edited 1 time in total.

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

Re: Defining derivatives and constrains?

Postby startz » Thu Oct 18, 2018 8:30 pm

c(2) is negative. c(2)^2 is not.

Simplifier12
Posts: 18
Joined: Tue Sep 18, 2018 8:45 pm

Re: Defining derivatives and constrains?

Postby Simplifier12 » Thu Oct 18, 2018 8:42 pm

startz wrote:c(2) is negative. c(2)^2 is not.


Hello Startz,

Thanks for your reply.

Oh you're right. I should calculate c(2)^2 for the primary constant. What about the failure notification of non-zero gradient in the results table, wouldnt it question the robustness or validation of the results?

Also for some sections of my data, I get negative R-squared and high probabilities (even 1.00) in results table. Isnt it an issue?

One more thing, I'm dummy in math and I've read in the other post that I should re-calculate the standard error for the primal constant. Since I'm using the c(2)^2 hack, how can I re-calculate the corresponding standard error? Since I'm doing c(2)^2, shall I do the same, i.e. SD^2?

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

Re: Defining derivatives and constrains?

Postby startz » Fri Oct 19, 2018 5:59 am

Simplifier12 wrote:
startz wrote:c(2) is negative. c(2)^2 is not.


What about the failure notification of non-zero gradient in the results table, wouldnt it question the robustness or validation of the results?


This means that EViews may not have converged to the optimum

Also for some sections of my data, I get negative R-squared and high probabilities (even 1.00) in results table. Isnt it an issue?


I'm not sure what you mean by "some sections of my data. R-squared applies to an entire regression.

One more thing, I'm dummy in math and I've read in the other post that I should re-calculate the standard error for the primal constant. Since I'm using the c(2)^2 hack, how can I re-calculate the corresponding standard error? Since I'm doing c(2)^2, shall I do the same, i.e. SD^2?

Use the coefficients View to test c(2)=0. The standard error will be computed as a side effect.

Simplifier12
Posts: 18
Joined: Tue Sep 18, 2018 8:45 pm

Re: Defining derivatives and constrains?

Postby Simplifier12 » Fri Oct 19, 2018 6:59 am

startz wrote:
Simplifier12 wrote:
startz wrote:c(2) is negative. c(2)^2 is not.


What about the failure notification of non-zero gradient in the results table, wouldnt it question the robustness or validation of the results?


This means that EViews may not have converged to the optimum

Also for some sections of my data, I get negative R-squared and high probabilities (even 1.00) in results table. Isnt it an issue?


I'm not sure what you mean by "some sections of my data. R-squared applies to an entire regression.

One more thing, I'm dummy in math and I've read in the other post that I should re-calculate the standard error for the primal constant. Since I'm using the c(2)^2 hack, how can I re-calculate the corresponding standard error? Since I'm doing c(2)^2, shall I do the same, i.e. SD^2?

Use the coefficients View to test c(2)=0. The standard error will be computed as a side effect.



[quote] I'm not sure what you mean by "some sections of my data. R-squared applies to an entire regression.
My data is for the period 1985-2016. When I run the estimation for example for the time period 2008-2016, I get negative value for R-squared. It also happens for some other time sections in my data.

[quote] Use the coefficients View to test c(2)=0. The standard error will be computed as a side effect.
Im not quite sure what it is and how I can find it in the View option.

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

Re: Defining derivatives and constrains?

Postby startz » Fri Oct 19, 2018 7:57 am

View/Coefficient diagnostics/Wald test

If you are getting a negative R^2 from least squares, you might want to post your output.

Simplifier12
Posts: 18
Joined: Tue Sep 18, 2018 8:45 pm

Re: Defining derivatives and constrains?

Postby Simplifier12 » Fri Oct 19, 2018 12:22 pm

Simplifier12 wrote:
startz wrote:
Simplifier12 wrote:
What about the failure notification of non-zero gradient in the results table, wouldnt it question the robustness or validation of the results?


This means that EViews may not have converged to the optimum

Also for some sections of my data, I get negative R-squared and high probabilities (even 1.00) in results table. Isnt it an issue?


I'm not sure what you mean by "some sections of my data. R-squared applies to an entire regression.

One more thing, I'm dummy in math and I've read in the other post that I should re-calculate the standard error for the primal constant. Since I'm using the c(2)^2 hack, how can I re-calculate the corresponding standard error? Since I'm doing c(2)^2, shall I do the same, i.e. SD^2?

Use the coefficients View to test c(2)=0. The standard error will be computed as a side effect.



I'm not sure what you mean by "some sections of my data. R-squared applies to an entire regression.
My data is for the period 1985-2016. When I run the estimation for example for the time period 2008-2016, I get negative value for R-squared. It also happens for some other time sections in my data.

Use the coefficients View to test c(2)=0. The standard error will be computed as a side effect.
Im not quite sure what it is and how I can find it in the View option.


Thanks.
The results table of the Wald test. But the value for standard error that is now shows is way too high. Many times higher than an individual data.
Image

Also, this is the results table with the negative R-squared.
Image

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

Re: Defining derivatives and constrains?

Postby startz » Fri Oct 19, 2018 1:21 pm

The negative R-squared indicates that the program has not converged to a global optimum. You may want to try different starting values.

More importantly: Estimating 4 parameters with 8 observations is usually pretty hopeless.

Simplifier12
Posts: 18
Joined: Tue Sep 18, 2018 8:45 pm

Re: Defining derivatives and constrains?

Postby Simplifier12 » Fri Oct 19, 2018 1:35 pm

startz wrote:The negative R-squared indicates that the program has not converged to a global optimum. You may want to try different starting values.

More importantly: Estimating 4 parameters with 8 observations is usually pretty hopeless.


Oh, I understand. Thanks for the explanation. Will look for how to do the staring values and if it works.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 12 guests