# PCA on the time series data yields first PC that has an opposite trend from all original time series

I have time series data with five variables that have common variation and trends and they are very noisy. I want to extract their common variation (most likely the first principal component) and use it in a regression model.

Below is the original data:

As you can see there is a strong correlation among the series, but they are very noisy.

Next I did PCA in R and extracted five components given below:

I am a bit puzzled, should not the PCs behave like the original series in terms of trends i.e. sloping downward? Well, at least one that explains most variation?

Just in case, the R code I used is

pcs=princomp(X[,2:6],cor=F)\$scores

• Well, one is trending -- the black one on your second plot, I'd bet it's the first PC. Maybe you are confused by the fact that it's trending upwards and not downwards? Well, the signs of the PCs are arbitrary, see stats.stackexchange.com/questions/88880. – amoeba May 17 '16 at 19:59
• Yes, that's the case. I normalised the PC1 on its first observation and got the trend sloping downards. This was enough to convince me that there was nothing wrong. – mr.rox May 18 '16 at 14:15

• A sometimes useful convention... A widespread convenience is to assign sign to a component/factor loadings so that the sum of its loadings (with the sign, and not squared) be positive. – ttnphns May 18 '16 at 17:00