long runvariance

For questions regarding programming in the EViews programming language.

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

selin1000
Posts: 40
Joined: Tue Mar 06, 2012 1:56 pm

long runvariance

Postby selin1000 » Sat Mar 17, 2012 1:59 pm

Hello! I am programming on Eviews and need to compute long run variance in my program at some point. Could anybody tell me what I should write in my code to get "long run variance" of a variable? Thank you so much for your help

Best

Selin

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

Re: long runvariance

Postby EViews Gareth » Sat Mar 17, 2012 2:16 pm

Look up lrcov in the object reference.

selin1000
Posts: 40
Joined: Tue Mar 06, 2012 1:56 pm

Re: long runvariance

Postby selin1000 » Sat Mar 17, 2012 3:02 pm

Thank you so much! :) I just looked up lrcov, but I am still a bit confused. Basically I am generating a new series x and I want to estimate its long run variance. I typed lrcov(x) but it tells me illegal command. How can I fix this? Thanks a lot again.

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: long runvariance

Postby trubador » Sun Mar 18, 2012 8:09 am

You have two alternatives in this case. The following should yield identical results (with default options):

Code: Select all

wfcreate u 100 series y = nrnd group g.add y y.lrvar g.lrcov

selin1000
Posts: 40
Joined: Tue Mar 06, 2012 1:56 pm

Re: long runvariance

Postby selin1000 » Sun Mar 18, 2012 11:30 am

Thank you so much, that was so helpful! :) Now I am able to compute long run variance, but I still cant use it in my formula. My code is as follows:

wfcreate u 276
scalar SC
series x=nrnd
x.lrvar
SC=276/x.lrvar*x.lrvar

However, that gives a syntax error. How can I make and use the long-run variance as a scalar value?

Thanks so much again! :)

Selin

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: long runvariance

Postby trubador » Sun Mar 18, 2012 2:11 pm

Code: Select all

wfcreate u 276 scalar SC series x=nrnd x.lrvar(out=lv) SC=276/(lv(1)*lv(1))

selin1000
Posts: 40
Joined: Tue Mar 06, 2012 1:56 pm

Re: long runvariance

Postby selin1000 » Tue Mar 20, 2012 12:19 pm

Thank you so much! It works great now! I appreciate it :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest