Dynamic principal components export

For questions regarding programming in the EViews programming language.

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

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Dynamic principal components export

Postby temp01 » Thu Feb 07, 2013 3:51 am

Hello,

I am using Eviews 7 on a Windows 7 machine. I am running a PCA and I want it to export principal compoenents dynamically, i.e. a loop from 1 to !F where !F is the number of principal components I need. Essentially if !F is 2 I want it to export 2 PCs, if !F is 4, 4 etc.

Code: Select all

%temp = "" for !i = 1 to !F step 1 %temp = %temp + " " + "pc" + !i next !i x.pcomp(eigval=eigval_x, eigvec=eigvec_x) {%temp}
That's what I tried so far but no joy. Thanks in advance for any help.

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Dynamic principal components export

Postby temp01 » Thu Feb 07, 2013 4:26 am

Also if anyone knows on a related note how to dynamically construct a VAR equation for a Kalman Filter. What I mean is for instance if I want 2 lags for 4 factors I will need to program a different equation than if I want 1 lag for 3 etc. Thank you.

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

Re: Dynamic principal components export

Postby EViews Gareth » Thu Feb 07, 2013 7:54 am

Code: Select all

%temp = %temp + " " + "pc" + @str(!i)

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Dynamic principal components export

Postby temp01 » Thu Feb 07, 2013 9:19 am

Thank you very much for the reply Gareth. Take care.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests