Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

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 : enter image description here

This is what i usually get for MIN variance :

enter image description here

This is what i usually get for MAX variance :

enter image description here

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

share|improve this question
3  
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. –  lmorin Jul 13 at 17:02
    
@lmorin : i've updated my question, these are not only weights but weigths multiplied by N-th observation –  Art Jul 13 at 17:37
    
@Imorin what are the approximations in the article? –  Richard Jul 14 at 8:40
    
Just looking quickly... try getting all of your variables denominated in USD. So for example usdchf should be chfusd. –  SpeedBoots Jul 14 at 12:10
    
I'm pretty sure that all they do is convert returns back to levels. –  John Jul 14 at 13:25

1 Answer 1

up vote 1 down vote accepted

Trying to answer:

  • in the blog post that you mention the author looks at three equity funds and one REIT fund. One could say that these markets are different to FX markets (for various reasons but let's start with the question whether there is a risk premium in FX markets).

  • what he does is the usual PCA analysis on the data. You find various questions in this forum and more links there. Look e.g. here: Calculating Variance Explained from PCA Loadings.

  • when you have understood the math (you can't go on without understanding the math) then you see that PCA is an analysis tool for what has happened. Apparently there is a principle portfolio that looks like an upward sloping trend. Just recall that the eigenvalue attached to PC 4 is rather small compared to the eigenvalues of 1-3. Thus if in-sample small changes could change the picture in-sample (!). Out-of-sample things can go totally different.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.