Documentation Center

  • Trial Software
  • Product Updates

estimateScenarioMoments

Class: PortfolioMAD

Estimate mean and covariance of asset return scenarios in PortfolioMAD object

Syntax

[ScenarioMean,ScenarioCovar] = estimateScenarioMoments(obj)

Description

[ScenarioMean,ScenarioCovar] = estimateScenarioMoments(obj) estimates the mean and covariance of asset return scenarios for a PortfolioMAD object.

Tips

Use dot notation to estimate the mean and covariance of asset return scenarios for a portfolio.

[ScenarioMean, ScenarioCovar] = obj.estimateScenarioMoments

Input Arguments

obj

MAD portfolio object [PortfolioMAD].

Output Arguments

ScenarioMean

Estimate for mean of scenarios [NumAssets vector] or [].

ScenarioCovar

Estimate for covariance of scenarios [NumAssets-by-NumAssets] matrix or [].

    Note:   If no scenarios are associated with the specified object, both ScenarioMean and ScenarioCovar are set to empty [].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

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

Examples

expand all

Estimate Mean and Covariance of Asset Return Scenarios

Given PortfolioMAD object p, use the estimatePortRisk method to estimate mean and covariance of asset return scenarios.

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 = PortfolioMAD;
p = p.setScenarios(AssetScenarios);
p = p.setDefaultConstraints;

[ScenarioMean, ScenarioCovar] = estimateScenarioMoments(p)
ScenarioMean =

    0.0039
    0.0082
    0.0102
    0.0154


ScenarioCovar =

    0.0005    0.0003    0.0001   -0.0001
    0.0003    0.0024    0.0017    0.0010
    0.0001    0.0017    0.0048    0.0028
   -0.0001    0.0010    0.0028    0.0102

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

See Also

| | | |

More About

Was this topic helpful?