Referencing Correlation Entries

For questions regarding programming in the EViews programming language.

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

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Referencing Correlation Entries

Postby diggetybo » Wed Jun 10, 2015 11:06 pm

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.

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

Re: Referencing Correlation Entries

Postby EViews Gareth » Thu Jun 11, 2015 4:29 am

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.

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Referencing Correlation Entries

Postby diggetybo » Thu Jun 11, 2015 8:08 am

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?

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

Re: Referencing Correlation Entries

Postby EViews Gareth » Thu Jun 11, 2015 9:02 am

series.correl. The full syntax is explained in the Object Reference.

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Referencing Correlation Entries

Postby diggetybo » Thu Jun 11, 2015 7:32 pm

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?

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

Re: Referencing Correlation Entries

Postby diggetybo » Tue Jun 16, 2015 9:03 pm

---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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest