Page 1 of 1

Dynamic principal components export

Posted: Thu Feb 07, 2013 3:51 am
by temp01
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.

Re: Dynamic principal components export

Posted: Thu Feb 07, 2013 4:26 am
by temp01
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.

Re: Dynamic principal components export

Posted: Thu Feb 07, 2013 7:54 am
by EViews Gareth

Code: Select all

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

Re: Dynamic principal components export

Posted: Thu Feb 07, 2013 9:19 am
by temp01
Thank you very much for the reply Gareth. Take care.