Description Usage Arguments Author(s) Examples
View source: R/summary.Markowitz.R
Summary method for objects of class Markowitz. For all portfolios on the efficient frontier, the expected return, standard deviation and asset weights are shown. If risk.free is given then efficient portfolios that are combinations of the risk free asset and the tangency portfolio are computed. The class summary.Markozitz will be created.
1 2 |
object |
object of class Markowitz |
risk.free |
numeric, risk free rate |
... |
additional arguments passed to summary() |
Eric Zivot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # construct the data
asset.names = c("MSFT", "NORD", "SBUX")
er = c(0.0427, 0.0015, 0.0285)
names(er) = asset.names
covmat = matrix(c(0.0100, 0.0018, 0.0011,
0.0018, 0.0109, 0.0026,
0.0011, 0.0026, 0.0199),
nrow=3, ncol=3)
r.free = 0.005
dimnames(covmat) = list(asset.names, asset.names)
# tangency portfolio
tan.port <- tangency.portfolio(er, covmat, r.free)
# compute global minimum variance portfolio
gmin.port = globalMin.portfolio(er, covmat)
# compute portfolio frontier
ef <- efficient.frontier(er, covmat, alpha.min=-2,
alpha.max=1.5, nport=20)
attributes(ef)
summary(ef)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.