You are on page 1of 2

Multi-group Model

YIK LUN, KEI


allen29@ucla.edu
library(stockPortfolio)
ticker <-

c("C", "KEY", "WFC", "SO", "DUK","D","HE", "EIX" ,"AMGN","GILD","CELG","BIIB","IMO",


"MRO","YPF","^GSPC")
#Industries:
ind <- c("Money Center Banks", "Money Center Banks", "Money Center Banks",
"Electrical Utilities", "Electrical Utilities", "Electrical Utilities",
"Electrical Utilities", "Electrical Utilities", "Biotechnology", "Biotechnology",
"Biotechnology", "Biotechnology", "Fuel Refining", "Fuel Refining",
"Fuel Refining", "Index")
gr1 <- getReturns(ticker, start='1999-12-31', end='2004-12-31')
#Multi group model (short sales, Rf=0):
mc <- stockModel(gr1, model='MGM', drop=16, industry=ind, shortSelling =T)
#identify the optimal portfolio for multi group model#
opmc <- optimalPort(mc)
#Plot the optimal portfolio and the stocks:
plot(opmc)
#Add the portfolio possibilities curve:
portPossCurve(mc, add=TRUE, riskRange=5)

0.00

0.01

0.02

Return

0.03

0.04

Risk and Return of Stocks

0.05

0.10

0.15

0.20

0.25

Risk
opmc
##
##
##
##
##
##
##
##
##
##
##

Model: multigroup model


Expected return: 0.02352588
Risk estimate:
0.03861769
Portfolio allocation:
C
KEY
WFC
-0.03089228 0.07541026 0.08379669
HE
EIX
AMGN
0.34260857 -0.06738994 -0.05173633
IMO
MRO
YPF
0.33206815 -0.01351500 -0.01593109

SO
DUK
0.20759892 -0.09766541
GILD
CELG
0.09659984 0.02280299

D
0.08609299
BIIB
0.03015163

You might also like