Learn R Programming

PortfolioAnalytics (version 2.0.0)

opt.outputMvo: Optimal Portfolio Weights and Performance Values

Description

Converts output of `optimize.portfolio` to a list of the portfolio weights, mean, volatility and Sharpe Ratio.

Usage

opt.outputMvo(
  opt,
  returns,
  digits = NULL,
  annualize = TRUE,
  frequency = "monthly",
  rf = 0
)

Value

A list containing the portfolio numeric weights, mean value, volatility and Sharpe Ratio.

Arguments

opt

List output of `optimize.portfolio`

returns

Multivariate xts object of portfolio assets returns

digits

Integer number of significant digits with default NULL

annualize

Logical with default TRUE

frequency

Returns frequency: "monthly", "weekly" or "daily"

rf

Numeric value with default 0.0

Author

R. Douglas Martin

Details

This function uses the weights returned by optimize.portfolio, along with the portfolio assets returns, and a risk-free rate, to to compute the portfolio mean return, volatility, and Sharpe Ratio.

Examples

Run this code
args(opt.outputMvo)

Run the code above in your browser using DataLab