Page 1 of 1

long runvariance

Posted: Sat Mar 17, 2012 1:59 pm
by selin1000
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

Re: long runvariance

Posted: Sat Mar 17, 2012 2:16 pm
by EViews Gareth
Look up lrcov in the object reference.

Re: long runvariance

Posted: Sat Mar 17, 2012 3:02 pm
by selin1000
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.

Re: long runvariance

Posted: Sun Mar 18, 2012 8:09 am
by trubador
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

Re: long runvariance

Posted: Sun Mar 18, 2012 11:30 am
by selin1000
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

Re: long runvariance

Posted: Sun Mar 18, 2012 2:11 pm
by trubador

Code: Select all

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

Re: long runvariance

Posted: Tue Mar 20, 2012 12:19 pm
by selin1000
Thank you so much! It works great now! I appreciate it :)