Main Content

entropyViews

R2026b

Create entropyViews object for entropy pooling of views on empirical distributions

Since R2026b

Description

Incorporate user-specified views into a multivariate empirical distribution using entropy pooling.

Use entropy pooling to combine a prior distribution with views you hold about the future to produce a posterior distribution. You start with a multivariate empirical distribution (for example, historical observations of market factors), then specify views on that distribution (such as expected changes to means or volatilities), and then compute posterior probabilities that reflect those views while minimizing the relative entropy between the prior and posterior distributions.

Use the entropyViews object to:

  • Store empirical distribution data and prior probabilities.

  • Specify views on the distribution using object functions such as setMeanViews and setVolatilityViews.

  • Compute posterior probabilities using posteriorProbabilities.

Creation

Description

obj = entropyViews(Data) creates an entropyViews object from the multivariate empirical distribution data specified by Data. The function interprets each row of Data as a scenario or observation comprising the distribution, and each column as a variable. The function assigns uniform prior probabilities to each scenario.

example

obj = entropyViews(___,Name=Value) creates an entropyViews object with additional options specified by one or more name-value arguments. For example, obj = entropyViews(Data,VariableNames=["SPX" "AAPL"]) creates an entropyViews object with custom variable names SPX and AAPL.

example

Input Arguments

expand all

Multivariate empirical distribution data, specified as a numeric table or matrix. Each row represents a scenario or observation and each column represents a variable in the distribution.

  • If Data is a table, then the function sets the VariableNames property using the VariableNames property of the table.

  • If Data is a matrix, then the function sets the VariableNames property to ["Var1", "Var2", ..., "VarN"], where N is the number of columns in Data, unless you specify the VariableNames name-value argument.

Name-Value Arguments

expand all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: obj = entropyViews(Data,PriorProbabilities=priors,VariableNames=["SPX" "AAPL" "MSFT"])

Prior probabilities for each scenario, specified as a vector with nonnegative entries. The number of entries in PriorProbabilities must equal the number of rows in Data. If the values in PriorProbabilities do not sum to 1, the function scales the values to make them sum to 1. If you do not specify the PriorProbabilities argument, then the function sets the PriorProbabilities property to a vector of M entries, each of which is equal to 1/M, where M is the number of rows in Data.

Data Types: double

Variable names for the columns in the distribution data, specified as a string vector. The number of entries in VariableNames must equal the number of columns in Data.

Note

Use this argument only if Data is a matrix. This function issues an error if you use this argument when Data is a table.

Output Arguments

expand all

Entropy views object, returned as an entropyViews object. Use the object functions to manage views and compute posterior probabilities.

Properties

expand all

This property is read-only.

Multivariate empirical distribution data, represented as a numeric matrix. Each row represents a scenario or observation and each column represents a variable in the distribution.

Data Types: double

This property is read-only.

Prior probabilities for each scenario, represented as a vector with entries in [0, 1].

Data Types: double

Names of views currently attached to the object, represented as a string vector. You can add views using the setMeanViews and setVolatilityViews object functions and you can delete views using the deleteViews object function.

Data Types: string

This property is read-only.

Variable names for the columns in the distribution data represented as a string vector.

Data Types: string

Object Functions

setMeanViewsSet views on variable means for entropyViews object
setVolatilityViewsSet views on variable volatilities for entropyViews object
posteriorProbabilitiesCompute posterior probabilities for entropyViews object
showViewsDisplay views for entropyViews object
deleteViewsDelete views from entropyViews object

Examples

collapse all

Create an entropyViews object from a multivariate empirical distribution of returns for five assets.

Create a multivariate empirical distribution, Data, of returns for five assets.

rng(13)

numScenarios = 10000;
mu = [0.08 0.1 0.06 0.12 0.09];
sigma = [0.15 0.2 0.12 0.25 0.18];
corrMatrix = [1 0.6 0.3 0.4 0.5; 0.6 1 0.4 0.5 0.6; 0.3 0.4 1 0.3 0.4; 0.4 0.5 0.3 1 0.5; 0.5 0.6 0.4 0.5 1];
covMatrix = diag(sigma)*corrMatrix*diag(sigma);
Data = mvnrnd(mu,covMatrix,numScenarios);

Create an entropyViews object from the returns.

obj = entropyViews(Data)
obj = 
  entropyViews with properties:

      DistributionData: [10000×5 double]
    PriorProbabilities: [10000×1 double]
                 Views: []
         VariableNames: ["Var1"    "Var2"    "Var3"    "Var4"    "Var5"]

Create an entropyViews object with custom prior probabilities and variable names from a multivariate empirical distribution of returns for three assets.

Create a multivariate empirical distribution, Data, of returns for three assets.

rng(13)

numScenarios = 10000;
mu = [0.08 0.1 0.06];
sigma = [0.15 0.2 0.12];
corrMatrix = [1 0.6 0.3; 0.6 1 0.4; 0.3 0.4 1];
covMatrix = diag(sigma)*corrMatrix*diag(sigma);
Data = mvnrnd(mu,covMatrix,numScenarios);

Create randomized prior probabilities. Optionally, normalize the probabilities. If you do not normalize the probabilities, the entropyViews function normalizes them automatically.

priors = rand(numScenarios,1);
priors = priors/sum(priors);

Create the entropyViews object. Use the PriorProbabilities and VariableNames name-value arguments to specify the prior probabilities and variable names, respectively.

obj = entropyViews(Data,PriorProbabilities=priors,VariableNames=["SPX" "AAPL" "MSFT"])
obj = 
  entropyViews with properties:

      DistributionData: [10000×3 double]
    PriorProbabilities: [10000×1 double]
                 Views: []
         VariableNames: ["SPX"    "AAPL"    "MSFT"]

More About

expand all

References

[1] Meucci, Attilio. "Fully Flexible Views: Theory and Practice." Risk 21, no. 10 (2008): 97–102.

Version History

Introduced in R2026b