Create a time trend

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

DannyB
Posts: 14
Joined: Sat Dec 19, 2015 10:43 am

Create a time trend

Postby DannyB » Thu Jun 02, 2016 3:30 am

Hi everyone,

I'm currently using C#.NET COM to execute EViews command.

But i have a problem.

I have a trend who count 588 data points and i want to create a time series who start at 1 and finish at 588 (the last count of my main trend).

How can i do that without using an "if next" statement? Now i'm using "series time_trend = @trend+1" because @trend start from 0 and to be sure i have tu create my own trend who start with the value 1.

Regards.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Create a time trend

Postby EViews Gareth » Thu Jun 02, 2016 3:56 am

@trend+1
Follow us on Twitter @IHSEViews

DannyB
Posts: 14
Joined: Sat Dec 19, 2015 10:43 am

Re: Create a time trend

Postby DannyB » Thu Jun 02, 2016 4:09 am

@trend is always starting from 0?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Create a time trend

Postby EViews Gareth » Thu Jun 02, 2016 4:44 am

Yes
Follow us on Twitter @IHSEViews

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Fri Apr 28, 2017 1:19 pm

Hello Gareth,

I would like to clarify a doubt: @trend starts from zero according to the range or the sample?
I've just run the function and realized that if sample < range, @trend starts from zero from the beginning of the range.
This happens with linear trends in cointegration estimations as well. Is there a way around this?

Many thanks!

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

Re: Create a time trend

Postby startz » Fri Apr 28, 2017 1:44 pm

Help @trend

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Fri Apr 28, 2017 2:08 pm

Thanks for your prompt reply.

I understand that one can specify @trend with the date where one would like to start, but what to do in the context of cointegration estimation where one chooses to use the specification with trend?

I just realized that in the context of ARDL estimation, the EC obtained in Proc->Make Cointegrating ... uses a trend initiated to the beginning of the range (and not to the beginning of the sample, as I was expecting). See excel file attached.
Attachments
evw_trend.xlsx
(18.54 KiB) Downloaded 547 times

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

Re: Create a time trend

Postby startz » Fri Apr 28, 2017 2:11 pm

Not really sure, but does it make any difference what the starting value of the trend is?

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Fri Apr 28, 2017 2:14 pm

In this case, yes, as you can see in the file: column K (and L), gives the EC using a trend set at the beginning of the range, while column M gives the EC with trend set at beginning of sample.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Create a time trend

Postby EViews Gareth » Fri Apr 28, 2017 2:25 pm

But does it matter as long as the trend uses in making the cointegrating relationship is the same trend that was used during estimation?
Follow us on Twitter @IHSEViews

EViews Mirza
Posts: 80
Joined: Sat Apr 22, 2017 8:23 pm

Re: Create a time trend

Postby EViews Mirza » Fri Apr 28, 2017 2:41 pm

EViews Gareth wrote:But does it matter as long as the trend uses in making the cointegrating relationship is the same trend that was used during estimation?


Indeed. Any deterministic dynamics (such as trends) used in estimation, must be identical to those used in deriving the EC term, otherwise, the model being suggested where the trend in the EC term is initiated at 1 at time t=T1, although the model estimated was initiated at t=1, would imply missing estimates proportional in magnitude of the missing trend elements 1, ... , T1, thereby creating bias in the estimation of the remaining variables. Estimating the model under one sample, and then artificially restarting the trend in the EC term for a sub-sample of the estimation is theoretically incorrect.

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Fri Apr 28, 2017 4:00 pm

Here's the problem I'm having, and the reason I started suspecting the trend issue.

I'm running ARDL estimation (including a linear trend) where I'm mostly interested in the long-run relationship.

I obtained the "Cointegration graph", but the scale do not make sense (it's way too big):
evw1.jpg
evw1.jpg (24.74 KiB) Viewed 18625 times


To double check, I got the "long-run" equation by running: long-run = dependent variable - cointeq
The implicit long-run is way off the scale of the dependent variable:
evw3.jpg
evw3.jpg (25.35 KiB) Viewed 18625 times


So, my suspicions are with the trend because when I run estimations using the full range, the scale of the "Cointegration graph" makes much more sense (-2% to 12%).

Unless the issue could be related to the fact that the constant disappears from the "levels equation":
evw2.jpg
evw2.jpg (123.39 KiB) Viewed 18625 times


Many thanks for your attention.

EViews Mirza
Posts: 80
Joined: Sat Apr 22, 2017 8:23 pm

Re: Create a time trend

Postby EViews Mirza » Fri Apr 28, 2017 4:11 pm

maragloria wrote:Here's the problem I'm having, and the reason I started suspecting the trend issue.


Could you provide the data you are working with in this example?

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Sat Apr 29, 2017 6:42 am

Sure. Thank you.
fairvalst.wf1
(428.08 KiB) Downloaded 407 times

maragloria
Posts: 101
Joined: Tue Jun 29, 2010 7:09 am

Re: Create a time trend

Postby maragloria » Sat Apr 29, 2017 7:34 am

Please note that simple OLS regression (using the @trend function) and Johasen estimation (case 4) do not have the problem.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 33 guests