MV | R Documentation |
Computes a Mean Variance portfolio with full investment and weight constraints.
MV(
sigma,
mu = NULL,
UB = NULL,
LB = NULL,
groups = NULL,
group.UB = NULL,
group.LB = NULL,
groups_mat = NULL,
gamma = 0
)
sigma |
a |
mu |
a |
UB |
scalar or |
LB |
scalar or |
groups |
vector of group IDs. The names of the vector must be identical to the asset names. |
group.UB |
scalar or |
group.LB |
scalar or |
gamma |
risk aversion parameter. Default: |
The argument sigma
is a covariance matrix.
The MV solution is calculated using quadprog
. When gamma
is left at the
default setting, the minimum variance portfolio is computed.
A (N \times 1)
vector of optimal portfolio weights.
Johann Pfitzinger
# Load returns of assets or portfolios
data("Industry_10")
rets <- Industry_10
sigma <- cov(rets)
MV(sigma, UB = 0.15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.