Documentation Center

  • Trial Software
  • Product Updates

simulateNormalScenariosByMoments

Class: PortfolioMAD

Simulate multivariate normal asset return scenarios from mean and covariance of asset returns for PortfolioMAD object

Syntax

obj = simulateNormalScenariosByMoments(obj,AssetMean,...
AssetCovar,NumScenarios)
obj = simulateNormalScenariosByMoments(obj,AssetMean,...
AssetCovar,NumScenarios,NumAsssets)

Description

obj = simulateNormalScenariosByMoments(obj,AssetMean,...
AssetCovar,NumScenarios)
to simulate multivariate normal asset return scenarios from a mean and covariance of asset returns or a MAD portfolio object.

obj = simulateNormalScenariosByMoments(obj,AssetMean,...
AssetCovar,NumScenarios,NumAsssets)
to simulate multivariate normal asset return scenarios from a mean and covariance of asset returns for a MAD portfolio object.

    Note:   This method overwrites existing scenarios associated with the PortfolioMAD object, and also, possibly, NumScenarios.

    If you want to use the method multiple times and you want to simulate identical scenarios each time the function is called, precede each function call with rng(seed) using a specified integer seed.

Tips

Use dot notation to simulate multivariate normal asset return scenarios from a mean and covariance of asset returns for a MAD portfolio object.

obj = obj.simulateNormalScenariosByMoments(AssetMean, AssetCovar, NumScenarios, NumAssets);

Input Arguments

obj

MAD portfolio object [PortfolioMAD].

AssetMean

Mean of asset returns [ vector]. If AssetMean is a scalar and the number of assets is known, scalar expansion occurs. If it is not possible to determine the number of assets, this method assumes that NumAssets = 1.

AssetCovar

Covariance of asset returns [matrix]. AssetCovar must be a symmetric positive-semidefinite matrix.

  • If AssetCovar is a scalar and the number of assets is known, a diagonal matrix is formed with the scalar value along the diagonals. If it is not possible to determine the number of assets, this method assumes that NumAssets = 1.

  • If AssetCovar is a vector, a diagonal matrix is formed with the vector along the diagonal.

NumScenarios

Number of scenarios to simulate.

NumAssets

(Optional) Number of assets [scalar].

Output Arguments

obj

Updated MAD portfolio object [PortfolioMAD].

Attributes

Accesspublic
Staticfalse
Hiddenfalse

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

Examples

expand all

Simulate Multivariate Normal Asset Return Scenarios from Moments

Given PortfolioMAD object p, use the simulateNormalScenariosByMoments method to simulate multivariate normal asset return scenarios from moments.

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;

AssetScenarios = mvnrnd(m, C, 20000);

p = PortfolioMAD;
p = p.setScenarios(AssetScenarios);
p = p.setDefaultConstraints;


AssetMean = [.5]
AssetCovar = [.5]
NumScenarios = 100

p = simulateNormalScenariosByMoments(p, AssetMean, AssetCovar, NumScenarios)
AssetMean =

    0.5000


AssetCovar =

    0.5000


NumScenarios =

   100


p = 

  PortfolioMAD with properties:

         BuyCost: []
        SellCost: []
    RiskFreeRate: []
        Turnover: []
     BuyTurnover: []
    SellTurnover: []
    NumScenarios: 100
            Name: []
       NumAssets: 4
       AssetList: []
        InitPort: []
     AInequality: []
     bInequality: []
       AEquality: []
       bEquality: []
      LowerBound: [4x1 double]
      UpperBound: []
     LowerBudget: 1
     UpperBudget: 1
     GroupMatrix: []
      LowerGroup: []
      UpperGroup: []
          GroupA: []
          GroupB: []
      LowerRatio: []
      UpperRatio: []

See Also

| |

More About

Was this topic helpful?