Description Usage Arguments Value Author(s) See Also Examples
Given a portfolio allocation X
and a model, identify the estimated return and risk associated with X
.
1 | portReturn(model, X)
|
model |
An object of class |
X |
The portfolio allocation. |
portReturn
returns a list of the following items:
R |
The estimated return. |
V |
The estimated risk squared. |
X |
The allocation, which is the second argument. |
ticker |
The tickers from the model. |
model |
An object of class |
David Diez
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #===> basics <===#
data(stock94)
sm <- stockModel(stock94, model='SIM', index=25)
op <- optimalPort(sm)
prOp <- portReturn(sm, op$X)
prUn <- portReturn(sm, rep(1, 24)/24)
print(prOp)
summary(prOp)
summary(prUn)
#===> plotting a "portReturn" object <===#
par(mfrow=c(2,2))
plot(prOp) # provides a heat map of the allocation
plot(prUn) # a boring heat map of allocation
plot(prOp, col=2:5) # many random colors
plot(prUn, col=1) # all black
|
Expected Return: 0.02319844
Risk estimate: 0.0258745
Stock distribution, by proportion of portfolio:
C KEY WFC JPM SO DUK D HE EIX LUV CAL
0.0348 -0.0131 0.0188 0.0267 0.16 0.142 0.183 0.233 0.0968 -0.00749 0.0254
AMR AMGN GILD CELG GENZ BIIB CAT DE HIT IMO
-0.0359 0.0616 0.0174 0.0066 0.0129 0.0411 0.0114 -0.0224 -0.0452 0.0804
MRO HES YPF
0.00931 -0.00381 -0.0332
Expected Return 0.02319844
Risk estimate 0.0258745
Expected Return 0.02523448
Risk estimate 0.04474968
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.