How to store autocorrelations

For questions regarding programming in the EViews programming language.

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

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

How to store autocorrelations

Postby cap » Wed Mar 25, 2009 12:53 pm

Hello,

I know that for a given series, I can view the ACF by doing var1.correl, but how can I actually record or access each of the individual autocorrelation values?

I was thinking that in a for loop, something like

myseries = var1.correl(10)

or

myvec(!i) = var1.correl(!i)

would work, but it would seem they do not...


Thanks in advance,
-cap

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

Re: How to store autocorrelations

Postby EViews Gareth » Wed Mar 25, 2009 1:31 pm

Try:

Code: Select all

vector(10) myvec

for !i=1 to 10
myvec(!i) = @cor(var1,var1(-!i))
next



This will get you almost identical results to the correl view. The difference is because the correl view uses an approximation to the individual correlations, whereas the code above uses exact calculations.
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 31 guests