Accelerating the pace of engineering and science

# estimatePortStd

Estimate standard deviation of portfolio returns for PortfolioMAD object

## Syntax

pstd = estimatePortStd(obj,pwgt)

## Description

pstd = estimatePortStd(obj,pwgt) estimates the standard deviation of portfolio returns. This method uses the asset return scenarios to compute the standard deviation of portfolio returns.

## Tips

You can also use dot notation to estimate the standard deviation of portfolio returns.

`pstd = obj.estimatePortStd(pwgt);`

## Input Arguments

 obj MAD portfolio object [PortfolioMAD]. pwgt Collection of portfolios [NumAssets-by-NumPorts matrix], where NumAssets is the number of assets in the universe and NumPorts is the number of portfolios in the collection of portfolios.

## Output Arguments

 pstd Estimates for standard deviations of portfolio returns for each portfolio in pwgt [NumPorts vector].

## Attributes

 Access public Static false Hidden false

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

## Examples

expand all

### Estimate Standard Deviations for Portfolio Returns

Given a portfolio pwgt, use the estimatePortStd method to show the standard deviation of portfolio returns.

```m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0;
0.00408 0.0289 0.0204 0.0119;
0.00192 0.0204 0.0576 0.0336;
0 0.0119 0.0336 0.1225 ];
m = m/12;
C = C/12;

rng(11);

AssetScenarios = mvnrnd(m, C, 20000);

p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);

pwgt = estimateFrontierLimits(p);

pstd = estimatePortStd(p, pwgt);
disp(pstd)
```
```    0.0222
0.1010

```

The function rng( ) resets the random number generator to produce the documented results. It is not necessary to reset the random number generator to simulate scenarios.