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.

In Meucci's paper called "Managing Diversification" he mentions that:

"Indeed, the eigenvalues A correspond to the variances of these uncorrelated portfolios"

I tried to replicate it but found they differ. Any thoughts?

> round(prin.port.risk,8) 
[1] 0.00017323 0.00013995 0.00030159 0.00007239
> round(eval,8)
[1] 0.00053912 0.00010127 0.00003948 0.00000730

Full R Code:

rm(list=ls())
require(RCurl)    
sit = getURLContent('https://github.com/systematicinvestor/SIT/raw/master/sit.gz',     binary=TRUE, followlocation = TRUE, ssl.verifypeer = FALSE)
con = gzcon(rawConnection(sit, 'rb'))
source(con)
close(con)
load.packages('quantmod,lattice')

#######################################################
#Get and Prep Data
#######################################################
data <- new.env()

tickers<-spl("VBMFX,VTSMX,VGTSX,VGSIX")
  getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env = data, auto.assign = T)
  for(i in ls(data)) data[[i]] = adjustOHLC(data[[i]], use.Adjusted=T)

bt.prep(data, align='remove.na', dates='1990::2013')

#################

prices<-data$prices
ret<-prices / mlag(prices) - 1
ret[1,]<-0
demean = scale(coredata(ret), center=TRUE, scale=FALSE)

#eigen decomposition of return (using "princomp")
pca<-princomp(ret,cor=F)
loadings<-pca$loadings[] #eigen vectors
    eval<-eigen(cov(demean))$values  #eigen values that supposedly represent risk of principal portfolios

prin.port.ret<-ret %*% loadings #principal port ret

#These two differ??!?!?!?!?
prin.port.risk<-(apply(prin.port.ret,2,var))
(eval)
share|improve this question
1  
If I run your code, I have identical values. Try in a fresh session (rm(list=ls()) is usually not sufficient). –  Vincent Zoonekynd Apr 16 '13 at 7:56
    
You could also try to contact Attilio directly - he is quite accessible. –  vonjd Apr 16 '13 at 8:29
    
Thanks, I am getting same values. R variables get messy –  user1234440 Apr 16 '13 at 23:44
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.