portfolioMarkowitz
Optimize mean variance Markowitz portfolio,
frontierMarkowitz
computes efficient frontier of portfolio,
montecarloMarkowitz
creates randomly created portfolios. }portfolioMarkowitz(x, targetReturn, title = NULL, description = NULL)
frontierMarkowitz(data, Rf = 0, short = FALSE, length = 300, r.range = NULL,
s.range = NULL, title = NULL, description = NULL, ...)
montecarloMarkowitz(object, mc = 5000, doplot = FALSE, add = TRUE, ...)## S3 method for class 'fPFOLIO':
print(x, \dots)
## S3 method for class 'fPFOLIO':
plot(x, alpha = 0.05, mc = 500, which = "ask", \dots)
## S3 method for class 'fPFOLIO':
summary(object, \dots)
mu
, the returns of the multivariate series, and
Sigma
, the covarianc"fPFOLIO"
object."fPFOLIO"
representing a portfolio.
A list with with elemets listed in the "Value" section.NULL
, the default
value, then the whole efficient frontier will be investigated."fPFOLIO"
object.which
can
be either a character string, "all"
(displays all plots)
or "ask"
(interactively asks which one to display), or a
vector of 6 logical "fPFOLIO"
representing a portfolio.
A list with with elemets listed in the "Value" seportfolioMarkowitz
frontierMarkowitz
return a S4 object class of class "fPFOLIO"
, with the following
slots:@pfolio
slot is a list with the following compontents:
(Note, not all are documented here).montecarloMarkowitz
is a functions which adds random generated portfolios to frontier
plot.
print
is the S3 print method for objects of class "fPFOLIO"
returned
from the function mvFit
. If shows a summary report of
the optimization results.
plot
is the S3 plot method for objects of class "fPFOLIO"
. Six plots
are produced.
The first plot produces a Risk-Return-Graph with the individual assets,
the efficient frontier, the market line, tangency portfolio and the
equal weights portfolio.
The second plot is the same as the first, however, the risk and return
values for random generated portfolios are added.
The third plot generates a pie chart of weights for the tangency
portfolio.
The third plot generates a pie chart of weights for the tangency
portfolio.
The fourth plot shows the effect of diversification.
The fivth plot shows the cumulated returns for the tangency
portfolio.
The sixth plot shows a histogram of the tangency portfolio returns
together with the maximum loss, the condition Value-at-Risk and the
upper CVaR.
summary
is the S3 summary method for objects of class "fPFOLIO"
. The
summary method prints and plots in one step the results as done by
the print
and plot
methods.Huang C.J., Litzenberger R.H. (1988); Foundations for Financial Economics, Elsevier, NY, pp. 59--82.
## SOURCE("fPortfolio.102C-MarkowitzPortfolio")
## berndtInvest -
data(berndtInvest)
# Exclude Date, Market and Interest Rate columns from data frame,
# then multiply by 100 for percentual returns ...
berndtAssets = berndtInvest[, -c(1, 11, 18)]
rownames(berndtAssets) = berndtInvest[, 1]
head(berndtAssets)
## portfolioMarkowitz -
myPortfolio = portfolioMarkowitz(x = berndtAssets, targetReturn = 20/100/12)
print(myPortfolio)
## pfolioTargetReturn -
## pfolioTargetRisk -
pfolioTargetReturn(x = berndtAssets, weights = myPortfolio@pfolio$pw)
pfolioTargetRisk(x = berndtAssets, weights = myPortfolio@pfolio$pw)
Run the code above in your browser using DataLab