STAR*

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Sat May 21, 2016 4:01 pm

NicolasR wrote:I looks like that the optimization algorithm does not reach convergence. You can try different strarting values. When I have no idea what values, what I usually do is to try random numbers for the starting values and I keep the ones that reach the best values of some criteria (BIC, AIC, R2,SSR). If this does not work you can change the convergence parameter of the optimization algorithm, the default can be changed in Options->General Options->Estimation Options.

For what I can see the model does not differ to much from a TAR. You can graph the transition function and the two time series over the same axis to see if the transition variable explains the divergence between the series.


Thank you this is very helpful. I have a hunch that my data is well suited to TAR model, but I need to fit the STAR model to compare and be sure. The histogram you see is for the first time series. I am now trying to build the STAR model for the second time series, but I am getting the errors I showed.

I will try the random numbers for starting values.

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Sun May 22, 2016 5:36 am

Dear Nicolas,

I believe I have corrected the problems I was having yesterday, which is shown in the above post. No matter which starting values I chose, and how I changed the convergence parameter, I just couldn't get reasonable results. I was having failure to converge which resulted in unreasonably large standard errors and p-values of exactly equal to 1.

So I believe it was due to the transition variable being in log-diff form. I had taken dlog(rvo) of my transition variable to ensure stationarity, but as it turns out, my transition variable is already stationary in level form under multiple tests for unit root. So when my transition variable is in levels, the model converge and a I get more reasonable results.

However this lead me to a new question about the tests for Linearity you describe in section 2.1 of the documentation. The transition variable fails to reject the null of linearity with p-value of 0.465. But the cubic expansion of the transition variable strongly reject the null of linearity. I'm confused by these contradictory results. Does this contradiction indicate problem with my choice of transition variable?

Thank you so much for your help!
Attachments
cubic.png
cubic.png (20.63 KiB) Viewed 2801 times

NicolasR
Posts: 80
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: STAR*

Postby NicolasR » Tue May 24, 2016 7:36 am

The final test that one should always do is to compare the linear model with the nonlinear in terms of adjustment, if the nonlinear one gives you better results you should keep it.

Regarding the stationarity of the transition variable, since you apply a funcion which codomine is bounded the resulting variable will tend to return to their mean, so I guess that the evaluated funcion will be a second order stationary variable, I'am not sure about this if I find something about it i will tell you.

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Tue May 24, 2016 5:24 pm

NicolasR wrote:The final test that one should always do is to compare the linear model with the nonlinear in terms of adjustment, if the nonlinear one gives you better results you should keep it.

Regarding the stationarity of the transition variable, since you apply a funcion which codomine is bounded the resulting variable will tend to return to their mean, so I guess that the evaluated funcion will be a second order stationary variable, I'am not sure about this if I find something about it i will tell you.


Thank you Nicolas, I truly appreciate your help!

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Mon Jul 25, 2016 7:57 pm

Dear Nicolas,

I am attempting some testing of adequacy in the post estimation of my STAR model. Specifically I'm attempting to test for the presence of no autocorrelation using the methods of Eitrheim and Terasvirta (1996). This is a Serial Correlation LM test which is Chi-squared distributed. However, I'm obtaining a negative LM test statistic. I'm thinking this simply means that the auxillary regression is clearly a worse fit than the estimated STAR model under the assumption of no autocorrelation. But I'm unsure because Chi-squared distributions are non-negative.

Summary of methods from Eitrheim and Terasvirta:

The test can be performed in three stages as follows.
(i) Estimate the STAR model by NLS under the assumption of uncorrelated errors and compute the residual sum of squares SSRo.
(ii) Estimate the auxillary equation and compute the residual sum of squares, SSR.
(iii) Compute the test statistic LM = {(SSRo- SSR)/q}/{SSR/(T- n- q)}, where n is the dimension of the gradient vector z.

Code: Select all

equation restricted.LS LRD6=C(1)+C(2)*LRD6(-1)+C(3)*ETHMRGN+C(4)*DLCORN+C(5)*LRD4+(C(6)+C(7)*LRD6(-1)+C(8)*ETHMRGN+C(9)*DLCORN+C(10)*LRD4)/(1+@EXP(-C(11)*(LRVO(-1)-C(12))/0.185725335183854))

series residsaved = resid_star_d6
restricted.@se
scalar ssr_res = restricted.@ssr


equation unres.LS resid_star_d6=C(1)+C(2)*LRD6(-1)+C(3)*ETHMRGN+C(4)*DLCORN+C(5)*LRD4+resid_star_d6(-1)+(C(6)+C(7)*LRD6(-1)+C(8)*ETHMRGN+C(9)*DLCORN+C(10)*LRD4+resid_star_d6(-1))/(1+@EXP(-C(11)*(LRVO(-1)-C(12))/0.185725335183854))+((1+@EXP(+405.766955136*(LRVO(-1)+0.374340794197)))^-2)*@EXP(+405.766955136*(LRVO(-1)+0.374340794197)) *(LRVO(-1)+0.374340794197)*(0.127293152902*LRD6(-1)+0.0457404726499*ETHMRGN-0.21312195182*DLCORN+0.492432175743*LRD4+(4.46766838498+11.5817705242*LRD6(-1)+6.99153891012*ETHMRGN+27.7593920141*DLCORN+8.49206117726*LRD4))+(-405.766955136)*((1+@EXP(+405.766955136*(LRVO(-1)+0.374340794197)))^-2)*@EXP(+405.766955136*(LRVO(-1)+0.374340794197)) *(LRVO(-1)+0.374340794197)*(0.127293152902*LRD6(-1)+0.0457404726499*ETHMRGN-0.21312195182*DLCORN+0.492432175743*LRD4+(4.46766838498+11.5817705242*LRD6(-1)+6.99153891012*ETHMRGN+27.7593920141*DLCORN+8.49206117726*LRD4))


scalar ssr_unres = unres.@ssr
scalar q = 1 'order of autocorrelation tested for
scalar ssr_diff = (ssr_res-ssr_unres)/q

scalar n =4 'dimension of gradients
scalar t = 269 'number of observations included in restricted estimation
scalar lm_test_stat = ssr_diff*(ssr_unres/(t-n-q))

lm_test_stat = -0.006877




Should this negative LM statistic give me concern? Or should I simply view it as very strong evidence of no autocorrelation?

mirkovitiello
Posts: 1
Joined: Thu Jul 28, 2016 5:51 am

Re: STAR*

Postby mirkovitiello » Thu Jul 28, 2016 6:06 am

I am conducting research on the real exchange rates of 28 countries against the us dollar.
I am using ESTAR model to test for PPP and I would greatly appreciate some help.
I am using a starting values for the vector coefficients of 0.5. Do you think that can work fine?
Why in running the LSTR and ESTR the dependent variable in the regression output is labeled DEP and does not appear the real exchange rate I am testing for? Is that correct or I am doing something wrong?

NicolasR
Posts: 80
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: STAR*

Postby NicolasR » Thu Aug 04, 2016 7:29 am

Dear Nicolas,

I am attempting some testing of adequacy in the post estimation of my STAR model. Specifically I'm attempting to test for the presence of no autocorrelation using the methods of Eitrheim and Terasvirta (1996). This is a Serial Correlation LM test which is Chi-squared distributed. However, I'm obtaining a negative LM test statistic. I'm thinking this simply means that the auxillary regression is clearly a worse fit than the estimated STAR model under the assumption of no autocorrelation. But I'm unsure because Chi-squared distributions are non-negative.

Summary of methods from Eitrheim and Terasvirta:

The test can be performed in three stages as follows.
(i) Estimate the STAR model by NLS under the assumption of uncorrelated errors and compute the residual sum of squares SSRo.
(ii) Estimate the auxillary equation and compute the residual sum of squares, SSR.
(iii) Compute the test statistic LM = {(SSRo- SSR)/q}/{SSR/(T- n- q)}, where n is the dimension of the gradient vector z.

Code: Select all

equation restricted.LS LRD6=C(1)+C(2)*LRD6(-1)+C(3)*ETHMRGN+C(4)*DLCORN+C(5)*LRD4+(C(6)+C(7)*LRD6(-1)+C(8)*ETHMRGN+C(9)*DLCORN+C(10)*LRD4)/(1+@EXP(-C(11)*(LRVO(-1)-C(12))/0.185725335183854))

series residsaved = resid_star_d6
restricted.@se
scalar ssr_res = restricted.@ssr


equation unres.LS resid_star_d6=C(1)+C(2)*LRD6(-1)+C(3)*ETHMRGN+C(4)*DLCORN+C(5)*LRD4+resid_star_d6(-1)+(C(6)+C(7)*LRD6(-1)+C(8)*ETHMRGN+C(9)*DLCORN+C(10)*LRD4+resid_star_d6(-1))/(1+@EXP(-C(11)*(LRVO(-1)-C(12))/0.185725335183854))+((1+@EXP(+405.766955136*(LRVO(-1)+0.374340794197)))^-2)*@EXP(+405.766955136*(LRVO(-1)+0.374340794197)) *(LRVO(-1)+0.374340794197)*(0.127293152902*LRD6(-1)+0.0457404726499*ETHMRGN-0.21312195182*DLCORN+0.492432175743*LRD4+(4.46766838498+11.5817705242*LRD6(-1)+6.99153891012*ETHMRGN+27.7593920141*DLCORN+8.49206117726*LRD4))+(-405.766955136)*((1+@EXP(+405.766955136*(LRVO(-1)+0.374340794197)))^-2)*@EXP(+405.766955136*(LRVO(-1)+0.374340794197)) *(LRVO(-1)+0.374340794197)*(0.127293152902*LRD6(-1)+0.0457404726499*ETHMRGN-0.21312195182*DLCORN+0.492432175743*LRD4+(4.46766838498+11.5817705242*LRD6(-1)+6.99153891012*ETHMRGN+27.7593920141*DLCORN+8.49206117726*LRD4))


scalar ssr_unres = unres.@ssr
scalar q = 1 'order of autocorrelation tested for
scalar ssr_diff = (ssr_res-ssr_unres)/q

scalar n =4 'dimension of gradients
scalar t = 269 'number of observations included in restricted estimation
scalar lm_test_stat = ssr_diff*(ssr_unres/(t-n-q))

lm_test_stat = -0.006877




Should this negative LM statistic give me concern? Or should I simply view it as very strong evidence of no autocorrelation?


Hi,

I have not read the paper, but as any statististical their distribution (chi-square in this case) is fulfilled under the null. But for my experience it is unusual to see a negative LM statistic, are you sure that your auxillary reached convergence?

Regards,
Last edited by NicolasR on Thu Aug 04, 2016 8:05 am, edited 1 time in total.

NicolasR
Posts: 80
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: STAR*

Postby NicolasR » Thu Aug 04, 2016 8:05 am

mirkovitiello wrote:I am conducting research on the real exchange rates of 28 countries against the us dollar.
I am using ESTAR model to test for PPP and I would greatly appreciate some help.
I am using a starting values for the vector coefficients of 0.5. Do you think that can work fine?
Why in running the LSTR and ESTR the dependent variable in the regression output is labeled DEP and does not appear the real exchange rate I am testing for? Is that correct or I am doing something wrong?


Hi,

I do not know if that starting values can work fine, you will have to find out by trial and error. You are not doing anything wrong, by default a copy of the variable you enter as the dependent variable is genereated and named dep, with this one the STAR model is estimated.

Good luck!

wxhdiy01
Posts: 21
Joined: Wed Apr 13, 2016 7:07 am

Re: STAR*

Postby wxhdiy01 » Sat Aug 20, 2016 6:58 am

Hi! I'm trying to write codes so that the fitness of different starting values are compared automatically. Since the add-in needs to be run many times and I don't want to have many equations in the workfile, I use delete command to get rid of the generated equations at each trial, and run the add-in again using the best starting value in the end to generate the final results. I'm getting errors saying "LSTR02 is not defined in "IF LSTR02.@AIC<-0.
504214828396386 THEN".", but I can't figure out what the problem is? Maybe it's something about how the equation is numbered in the add-in? Could you help take a look at the code? Thanks!

Code: Select all

for !n=1 to 8
   !mininfocrit=10
   %reg=""
   %y="y1  y2 y3 y4 y5 y6 y7 y8"
   %thresh="(-1) (-1) (-3) (-1) (-4) (-4) (-1) (-2)"
   %new=@word(%y,!n)
   for !lnlag=1 to blag_{%new}
      %reg=%reg+%new+"("+@str(-!lnlag)+")"+" " 'Best lag length from linear model. If best lag length is 3, %reg becomes y1(-1) y1(-2) y1(-3)
   next
   for !m=-0.2 to 0.4 step 0.1 'try different starting value for sv
   vector(23) sv_!n=!m
   %thresh_lag=%new+@word(%thresh,!n)  'This is the threshold variable from the self-exciting TAR model
   {%new}.star(variables=%reg, transition=%thresh_lag,lstr,sv=sv_!n,evaluation)
   if lstr0{!n}.@aic<!mininfocrit then   'Compare AIC
      !mininfocrit=lstr0{!n}.@aic   
      vector(23) svbest_!n=sv_!n     'Save the best sv
      delete lstr*
   endif
   next
      delete str_test*
      delete transition_lstr*
      {%new}.star(variables=%reg, transition=%thresh_lag,lstr,sv=svbest_!n,evaluation) 'Re-generate the final equations and tests
next

wxhdiy01
Posts: 21
Joined: Wed Apr 13, 2016 7:07 am

Re: STAR*

Postby wxhdiy01 » Sat Aug 20, 2016 7:32 am

Problem solved, however it still cannot help find the correct starting value efficiently :(

Code: Select all

   if lstr0{!n}.@aic<!mininfocrit then
      !mininfocrit=lstr0{!n}.@aic   
      vector(23) svbest_!n=sv_!n
   endif
   delete lstr0{!n}
   if !n>1 then
      !n_1=!n-1
      delete str_tests0{!n_1}
   else delete str_tests
   endif
   delete transition_lstr0{!n}
   next
   {%new}.star(variables=%reg, transition=%thresh_lag,lstr,sv=svbest_!n,evaluation)
next

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Fri Mar 10, 2017 9:51 am

Hi,

I am getting an error message these days when I try to run the STAR package. This just recently started. I cannot figure out why this problem is occurring, as the package was working fine just yesterday.
Attachments
eviews_error.png
eviews_error.png (29.87 KiB) Viewed 1436 times

shadi71h
Posts: 1
Joined: Tue Mar 14, 2017 11:15 pm

Re: STAR*

Postby shadi71h » Thu Mar 16, 2017 1:25 am

hi
how can i do mrstar in eviews?
i can do star but cant mr star

NicolasR
Posts: 80
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: STAR*

Postby NicolasR » Tue Mar 21, 2017 7:21 am

elmst616 wrote:Hi,

I am getting an error message these days when I try to run the STAR package. This just recently started. I cannot figure out why this problem is occurring, as the package was working fine just yesterday.


Hi,

It is because the LM_1 statistical is negative, It has never happened to me. Could you post your workfile and your code to replicate the error?

Regards,

NicolasR
Posts: 80
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: STAR*

Postby NicolasR » Tue Mar 21, 2017 7:23 am

shadi71h wrote:hi
how can i do mrstar in eviews?
i can do star but cant mr star


With the STAR add-in you can not.

elmst616
Posts: 28
Joined: Fri Apr 29, 2016 2:36 pm

Re: STAR*

Postby elmst616 » Tue Mar 28, 2017 10:03 am

NicolasR wrote:
elmst616 wrote:Hi,

I am getting an error message these days when I try to run the STAR package. This just recently started. I cannot figure out why this problem is occurring, as the package was working fine just yesterday.


Hi,

It is because the LM_1 statistical is negative, It has never happened to me. Could you post your workfile and your code to replicate the error?

Regards,


Hi Nicolas, sorry for the delay in my reply. I'm not quite sure what was causing this error. I basically wiped my workfile and started fresh and I have since not received that error.

Thank you for offering to help though!


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 2 guests