# How to get permanently growing chart within PCA

I looked onto different questions and answers about application of PCA on this site and found this interesting article :

http://systematicedge.wordpress.com/2013/06/02/principal-component-analysis-in-portfolio-management/

It shows that after application of the PCA it is possible to get Eigen Portfolio that is permanently growing like almost straight line going up. I am using AlgLib to apply PCA to the list of currency timeseries and looking at the charts i am almost sure that it is applied correctly at least because it correctly identifies the currency pair that adds the most variance to the portfolio.

Unfortunately, neither eigenportfolio in my case look like the one displayed on this screenshot (PC4) :

What i need is : This is what i usually get for MIN variance : This is what i usually get for MAX variance : Question : how can i get the chart that would look like the one marked as PC4 on the screenshot above?

Update # 1 :

There are a lot of code and it is not well-formed so i will display only meaningful calculations with the following terms :

• Prices = Returns
• iOrder = K = number of assets, currency pairs
• iDepth = N = number of observations, prices for each currency pair
• Period = Time Frame e.g. 1 Day = in this example it means that 1 observation = 1 daily price
• iSeries = Matrix K x N = source matrix that contains data synchronized by time
• iCharts = Matrix K x N = matrix that contains correctly scaled returns e.g. log(returns)
• Synthetics = plot that mimics open position on portfolio

1) Synchronize(iPrices, Period, iOrder, iDepth) - synchronize assets by date and time

2) GetEquityMatrix(iSeries, iCharts, iOrder, iDepth) - measure every currency in USD (i can use Log(Prices) here instead)

3) CAlglib::PCABuildBasis(iCharts, iDepth, iOrder, result, iEigenValues, iEigenVectors) - actual calculation of eigen values and eigen vectors

4) Synthetics[N] = Sum(iCharts[0...K][N] x iEigenVectors[0...K][IndexOfVectorWithNeededVariance e.g. 0]) - calculation of N-th value on the chart

• 1) There is some dangerous approximations on the article you linked. 2) They lead to approximations from you: no there is no garanteed portfolio wich is almost increasing. 3) Your plot is not available anymore, but it look like you ploted the weigth of an asset inside the PCA. You should add your code if you want us to point out what is wrong. Jul 13, 2014 at 17:02
• @lmorin : i've updated my question, these are not only weights but weigths multiplied by N-th observation Jul 13, 2014 at 17:37
• @Imorin what are the approximations in the article? Jul 14, 2014 at 8:40
• Just looking quickly... try getting all of your variables denominated in USD. So for example usdchf should be chfusd. Jul 14, 2014 at 12:10
• I'm pretty sure that all they do is convert returns back to levels.
– John
Jul 14, 2014 at 13:25