主要内容

showViews

R2026b

Display views for entropyViews object

Since R2026b

Description

showViews(obj) displays information about all views associated with the entropyViews object obj.

example

showViews(obj,viewNames) displays information about the views specified by viewNames.

example

Examples

collapse all

Display information about all views of an entropyViews object.

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

rng(13)

numScenarios = 100000;
mu = [0.08 0.10 0.06];
sigma = [0.15 0.20 0.12];
corrMatrix = [1.0 0.6 0.3; 0.6 1.0 0.4; 0.3 0.4 1.0];
covMatrix = diag(sigma)*corrMatrix*diag(sigma);
Data = mvnrnd(mu, covMatrix, numScenarios);

Create an entropyViews object and three views from the returns.

obj = entropyViews(Data,VariableNames=["SPX" "AAPL" "MSFT"]);
obj = setMeanViews(obj,"SPX",">",0.1,ViewNames="BullishSPX");
obj = setMeanViews(obj,"AAPL","=",0.12,ViewNames="AAPLTarget");
obj = setVolatilityViews(obj,"MSFT","<",0.1,ViewNames="LowVolMSFT");

Display information about all views.

showViews(obj)
View: BullishSPX
Type:         Mean
Variable:     SPX
Constraint:   Mean >= 0.1
Relation:     GreaterThan

View: AAPLTarget
Type:         Mean
Variable:     AAPL
Constraint:   Mean = 0.12
Relation:     EqualTo

View: LowVolMSFT
Type:         Volatility
Variable:     MSFT
Constraint:   Volatility <= 0.1
Relation:     LessThan

Display information about one specific view of an entropyViews object.

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

rng(13)

numScenarios = 100000;
mu = [0.08 0.10 0.06];
sigma = [0.15 0.20 0.12];
corrMatrix = [1.0 0.6 0.3; 0.6 1.0 0.4; 0.3 0.4 1.0];
covMatrix = diag(sigma)*corrMatrix*diag(sigma);
Data = mvnrnd(mu, covMatrix, numScenarios);

Create an entropyViews object and three views from the returns.

obj = entropyViews(Data,VariableNames=["SPX" "AAPL" "MSFT"]);
obj = setMeanViews(obj,"SPX",">",0.1,ViewNames="BullishSPX");
obj = setMeanViews(obj,"AAPL","=",0.12,ViewNames="AAPLTarget");
obj = setVolatilityViews(obj,"MSFT","<",0.1,ViewNames="LowVolMSFT");

Display information about the BullishSPX view.

showViews(obj,"BullishSPX")
View: BullishSPX
Type:         Mean
Variable:     SPX
Constraint:   Mean >= 0.1
Relation:     GreaterThan

Input Arguments

collapse all

Entropy views object, specified as an entropyViews object.

Names of views, specified as a string vector.

Output Arguments

collapse all

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

Version History

Introduced in R2026b