Create a time trend

For questions regarding programming in the EViews programming language.

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

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

Re: Create a time trend

Postby EViews Mirza » Sat Apr 29, 2017 12:40 pm

maragloria wrote:Sure. Thank you.


Ok, I've played with your data, and there are a few things I noticed. You are using daily data (5 day week) from January 4, 2010 to April 26, 2017, with a total of 1829 observations. However, the graphs you generated, and the estimation you conducted, was on the sample running from January 24, 2017 to April 26, 2017, with a total of 65 observations. For daily data, this is a very small sample.

Going back to your concern, however, let's run everything on the full sample first. However, we will generate a model in which we account for the constant in the long run equation along with the trend. We will have to do this manually since this case is not considered in either Pesaran Shin Smith (2001) nor in EViews. Note that if we do this, however, the F-Bounds statistic is no longer valid since the table you are being presented with, is for the cases which are supported by the paper. Thus, if you want to conduct any sort of inference based on this model, it will be incorrect unless you come up with your own distributional tables for this scenario. However, if the point is to simply see whether things line up, then, we can show that indeed, the discrepancy is because the constant is NOT a part of the long-run equation along with the trend. The exercises are below.

Code: Select all

'Run everything on full sample
smpl @all

'Run ARDL estimation
equation ardl_fs.ardl(ic=bic, trend=linear, cov=hac, covlag=a, covinfosel=sic) usdcadln wtiln spivol1m spread1y1y_ca

'Make the cointegrating Equation
ardl_fs.makecoint ec_fs

'Make Long Run Equation (WITHOUT constant)
series lr_fs_noc = usdcadln - ec_fs

'Make Long Run Equation (WITH constant): We do this by taking the estimate of the constant C, which is 0.007333 and then we divide by the negative of the estimate of USDCADLN(-1), namely -0.013737. Thus, we have that the long run constant is LRC = 0.007333/0.13737. Accordingly:

series lr_fs_withc = (usdcadln - ec_full_sample) + 0.007333/0.013737

'Group the relevant series together:
group group_ardl usdcadln ec_fs lr_fs_noc lr_fs_withc

'Plot all series
group_ardl.line


ardl_fs.jpg
ardl_fs.jpg (184.48 KiB) Viewed 2903 times

graph1.jpg
graph1.jpg (50.7 KiB) Viewed 2903 times


Of course, you can do everything on the restricted sample, and the results should look similar. Here's the outcome:

Code: Select all

smpl 1/24/2017 @last
equation ardl_rs.ardl(ic=bic, trend=linear, cov=hac, covlag=a, covinfosel=sic) usdcadln wtiln spivol1m spread1y1y_ca
ardl_rs.makecoint ec_rs
series lr_rs_noc = usdcadln - ec_rs
series lr_rs_withc = (usdcadln - ec_rs) -0.333144/0.255194
group group_ardl usdcadln ec_rs lr_rs_noc lr_rs_withc
group_ardl.line


graph3.jpg
graph3.jpg (35.8 KiB) Viewed 2903 times


Note however that I had to change the long-run constant in the restricted sample to match the estimates for that regression. Clearly things line up rather well.

Let me know if this has clarified your concerns.

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

Re: Create a time trend

Postby maragloria » Sat Apr 29, 2017 2:14 pm

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


Actually, there's a small difference. It's just more sutle with OLS regression.

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

Re: Create a time trend

Postby maragloria » Sat Apr 29, 2017 5:03 pm

Thanks Mirza. Your solution works really well. I'm using different sample sizes (the smallest being 65/3m) to see the impact on the LR betas. For all the samples used everything lines up now. Thanks again.


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 17 guests