[R-SIG-Finance] Portfolio Optimization Combination problem
samshky
samir.purple at gmail.com
Tue May 14 18:46:45 CEST 2013
I load the following library
library("fPortfolio")
then i use the avaialable data of the library fportfolio
data = SPISECTOR.RET
names(data)
[1] "SPI" "BASI" "INDU" "CONG" "HLTH" "CONS" "TELE" "UTIL" "FINA" "TECH"
SPISECTOR.RET consists the retunrs of above 10 sectors.
When investors wants to invest in these 10 sector using following code i
find the tangency and minimum variance portfolio with
tangencyPortfolio(data, spec = portfolioSpec(), constraints = "LongOnly")
minvariancePortfolio(data, spec = portfolioSpec(), constraints = "LongOnly")
But, Say an investor wants to know the Global Minimum Variance Portfolio and
tangencyPortfolio among the various portfoilo consist of these 10 sectors.
THis is my question and what can be the code for such problem?
My rough ideam be:
We may need a dataframe or matrix say "MATALL" which consist the the various
combinations portfolios of these sectors like
portfolio1 = SPI
portfolio2 = BASI
.......
.......
portfolio9 = TECH
portfolio10 = c(SPI, BASI)
portfolio11 = c(SPI, INDU)
portfolio12 = c(SPI, CONG)
.......
.......
Portfolio511 = c(SPI, BASI, INDU, CONG, HLTH, CONS, TELE, UTIL, FINA, TECH)
Then we need another matrix or dataframe say "MAT" which exclude portfolio1
to portfolio9 because of the portfolio optimization problem ie
MAT consist from portfolio10 to portfolio 511.
Now we need mean mu Cov Sigma CVaR VaR of tangencyPortfolio of
each of the portfolios in MAT and export it to Excel file
Similarly
we need mean mu Cov Sigma CVaR VaR of minvariancePortfolio of
each of the portfolio in MAT and export it to Excel file
Thanks Samir
--
View this message in context: http://r.789695.n4.nabble.com/Portfolio-Optimization-Combination-problem-tp4667054.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list