estimateScenarioMoments

Class: PortfolioCVaR

Estimate mean and covariance of asset return scenarios in PortfolioCVaR object

Syntax

[ScenarioMean,ScenarioCovar] = estimateScenarioMoments(obj)

Description

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

Tips

You can also use dot notation to estimate the mean and covariance of asset return scenarios for a portfolio.

[ScenarioMean, ScenarioCovar] = obj.estimateScenarioMoments

Input Arguments

obj

CVaR portfolio object [PortfolioCVaR].

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 PortfolioCVaR 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 = PortfolioCVaR;
p = setScenarios(p, AssetScenarios);
p = setDefaultConstraints(p);
p = setProbabilityLevel(p, 0.95);

[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.

Was this topic helpful?