30.sim_ccm_stockPortfolio

30.sim_ccm_stockPortfolio - # #=> ( 2 ) <=# #=> main...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
########################## #===> ((((( 2 ))))) <===# #===> main functions <===# ########################## #===> obtain a lot of tickers via included data set <===# library(stockPortfolio) #DATA: ticker <- c("C", "KEY", "WFC", "JPM", "SO", "DUK", "D", "HE", "EIX", "LUV", "AMR", "AMGN", "GILD", "CELG", "GENZ", "BIIB", "CAT", "DE", "HIT", "IMO", "MRO", "HES", "YPF", "^GSPC") #===> get data <===# gr1 <- getReturns(ticker, start='1999-12-31', end='2004-12-31') summary(gr1) gr1$R # returns gr1$ticker # original ticker gr1$period # sample spacing gr1$start # when collection started gr1$end # when collection ended #===> simple model building <===# ======================================================================== #No model - classical Markowitz model: m1 <- stockModel(gr1, drop=24) # drop index summary(m1) #Find the point of tangency: op1 <- optimalPort(m1) #Type op1 to see the composition of the point of tangency: op1 #Plot the 24 stocks and point G (point of tangency): plot(op1, xlim=c(0,0.3))
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/02/2011 for the course STATS 183 taught by Professor Nicolas during the Spring '11 term at UCLA.

Page1 / 3

30.sim_ccm_stockPortfolio - # #=> ( 2 ) <=# #=> main...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online