Page 1 of 1

Referencing Correlation Entries

Posted: Wed Jun 10, 2015 11:06 pm
by diggetybo
Hello,

I'm familiar with the syntax for displaying sample correlations in eviews, i.e. :

Code: Select all

cor x1 x2 x3
Question #1: instead of an output matrix of sample correlations, I want to code a vector that displays only the correlations between, say, x1 & x2 & x3, (omitting the entry that is correlation with itself). Perhaps this done through referencing the exact element in the correlation matrix or some other related syntax?

Question #2: Does eviews have a dedicated syntax for autocorrelation (first order, 2nd order, ect) for a series called x1? In this case, viewing any i-th order autocorrelation for series x1 in scalar form would work for me.

Re: Referencing Correlation Entries

Posted: Thu Jun 11, 2015 4:29 am
by EViews Gareth
You'll have to extract the non-diagonal elements from the correlation matrix - we don't have a way to just calculate the cross-correlations without the diagonals.

series.correl shows the autocorrelations.

Re: Referencing Correlation Entries

Posted: Thu Jun 11, 2015 8:08 am
by diggetybo
Thanks for clearing the first part up.

The autocorrleation portion though, I was more after a syntax to reference the autocorrelation by its order, rather than call the user interface.

for example if I want to view the 3rd order auto correlation of series "x1" in scalar form, what kind of code would eviews need?

Re: Referencing Correlation Entries

Posted: Thu Jun 11, 2015 9:02 am
by EViews Gareth
series.correl. The full syntax is explained in the Object Reference.

Re: Referencing Correlation Entries

Posted: Thu Jun 11, 2015 7:32 pm
by diggetybo
Looking through version 8's command reference, I did find a segment covering autocorrelation by order, like:

Code: Select all

show x1.correl(3)
however it doesn't seem to work for viewing the autocorrelation entry as a scalar...

Code: Select all

scalar x1_ac3 = x1.correl(3)
returns the error: "correl(3) is not a member or procedure of x1"

ideally, I'd like to create a scalar that contains the 3rd degree autocorrelation value for the series.

any ideas?

Re: Referencing Correlation Entries

Posted: Tue Jun 16, 2015 9:03 pm
by diggetybo
---UPDATE--- 06/16/2015

The object reference does explain the syntax, but it basically just said series_name.correl(n, options).

The closest I got to referencing the autocorrelation by order within a scalar was by freezing into a table.

Code: Select all

freeze(autocor) x1.correl(3)

I have two questions:

1. When I call the function x1.correl it displays all lags up to n, in the above case 1 to 3. Is there any way to call only n, and no lags before?

2. Is it possible to freeze into a scalar instead of a table? If not, what is the best way to convert a table element into a scalar?

Please advise

Thanks again