portvar

Variance for portfolio of assets

Syntax

``V = portvar(Asset)``
``V = portvar(Asset,Weight)``

Description

example

````V = portvar(Asset)` assigns each security an equal weight when calculating the portfolio variance. NoteAn 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 using `Portfolio` objects, see Portfolio Object Workflow. ```

example

````V = portvar(Asset,Weight)` returns the portfolio variance as an `R`-by-`1` vector (assuming `Weight` is a matrix of size `R`-by-`N`) with each row representing a variance calculation for each row of `Weight`.```

Examples

collapse all

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 ```

Input Arguments

collapse all

Asset Returns, specified as a `M`-by-`N` matrix of `M` asset returns for `N` securities.

Data Types: `double`

Portfolio weights, specified as a `R`-by-`N` matrix of `R` portfolio weights for `N` securities. Each row of `Weight` constitutes a portfolio of securities in `Asset`.

Data Types: `double`

Output Arguments

collapse all

Variance of portfolio assets, returned as a numeric value.

References

[1] Bodie, Kane, and Marcus. Investments. McGraw Hill, Chapter 7, 2013.

Version History

Introduced before R2006a