Variance for portfolio of assets
An alternative for portfolio optimization is to use the
Portfolio object for
mean-variance portfolio optimization. This object supports gross or net
portfolio returns as the return proxy, the variance of portfolio returns as
the risk proxy, and a portfolio set that is any combination of the specified
constraints to form a portfolio set. For information on the workflow when
Portfolio objects, see Portfolio Object Workflow.
Compute Variance of Portfolio Assets
This example shows how to use
portvar to compute the variance of portfolio assets. When you don't specify weights,
portvar assigns each security an equal weight when calculating the portfolio variance.
load FundMarketCash Returns = tick2ret(TestData); Fund = Returns(:,1); portvar(Fund)
ans = 5.3465e-04
Asset — Asset returns
Asset Returns, specified as a
M asset returns for
Weight — Portfolio weights
Portfolio weights, specified as a
N matrix of
R portfolio weights for
securities. Each row of
Weight constitutes a portfolio of
V — Variance of portfolio assets
Variance of portfolio assets, returned as a numeric value.
 Bodie, Kane, and Marcus. Investments. McGraw Hill, Chapter 7, 2013.
Introduced before R2006a