[R-sig-Geo] PCA Regression

tony333 tony333_6 at hotmail.com
Thu Aug 2 16:12:42 CEST 2012


http://r-sig-geo.2731867.n2.nabble.com/file/n7580665/pc.dat pc.dat 
http://r-sig-geo.2731867.n2.nabble.com/file/n7580665/precip.dat precip.dat 
I use PCA regression to make seasonal forecast for precipitation using PCA
of SST. 
I have 30 month of SST monthly mean data.I use the whole data (30 month) to
produce PCA .The dimension of PCA is 30*1. 
the data is attached with the e_mail.
For example i use :-
data.train=1:15 # the first 15 scores of PCs as train data 

xy.lm =  lm(Y~pc1[data.train]+pc2[data.train]+pc5[data.train] )
where Y = the predictand (precipitation) 


f =
predict(xy.lm,list(pc1[data.train]=pc1[data.train],pc2[data.train]=pc2[data.train],pc5[data.train]=pc5[data.train]))



and use the rest 15 score to verified the prediction
data.verif=16:30
ff <-
coef(xy.lm)[1]+(coef(xy.lm)[2])*pc1[data.verif]+(coef(xy.lm)[3])*pc2[data.verif]+(coef(xy.lm)[4])*pc5[data.verif]

is that the right way to predict and verified this prediction 

or i have to produce PCA for 15 month to train data and use the rest 15
month to produce another  PCA to verified the prediction .






--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/PCA-Regression-tp7580665.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list