java.lang.Object
org.ojalgo.data.domain.finance.portfolio.FinancePortfolio
org.ojalgo.data.domain.finance.portfolio.BlackLittermanModel
- All Implemented Interfaces:
Comparable<FinancePortfolio>,FinancePortfolio.Context
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ojalgo.data.domain.finance.portfolio.FinancePortfolio
FinancePortfolio.Context -
Field Summary
Fields inherited from class org.ojalgo.data.domain.finance.portfolio.FinancePortfolio
MATRIX_FACTORY -
Constructor Summary
ConstructorsConstructorDescriptionBlackLittermanModel(FinancePortfolio.Context context, FinancePortfolio originalWeights) BlackLittermanModel(MarketEquilibrium marketEquilibrium, MatrixR064 originalWeights) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddView(FinancePortfolio aView) voidaddViewWithBalancedConfidence(List<BigDecimal> someWeights, Comparable<?> aReturn) voidaddViewWithScaledConfidence(List<BigDecimal> someWeights, Comparable<?> aReturn, Comparable<?> aScale) voidaddViewWithStandardDeviation(List<BigDecimal> weights, BigDecimal expected, BigDecimal stdDev) protected MatrixR064protected final MatrixR064calculateAssetReturns(MatrixR064 aWeightsVctr) protected MatrixR064protected final MatrixR064calculateAssetWeights(MatrixR064 aReturnsVctr) final doublecalculatePortfolioReturn(FinancePortfolio weightsPortfolio) protected final Scalar<?> calculatePortfolioReturn(MatrixR064 aWeightsVctr, MatrixR064 aReturnsVctr) final doublecalculatePortfolioVariance(FinancePortfolio weightsPortfolio) protected final Scalar<?> calculatePortfolioVariance(MatrixR064 aWeightsVctr) protected final voidcalibrate(MatrixR064 aWeightsVctr, MatrixR064 aReturnsVctr) final MatrixR064final MatrixR064final MatrixR064Scalar<?> "weight on views" or "tau" A parameter that describes the general confidence in the views.final MatrixR064final MatrixR064final MarketEquilibriumfinal doubleThe mean/expected return of this instrument.protected MatrixR064protected MatrixR064final doubleThe instrument's return variance.final Scalar<?> final String[]protected MatrixR064protected MatrixR064Scaled by risk aversion factor.protected List<FinancePortfolio> getViews()protected MatrixR064Scaled by tau / weight on viewsfinal List<BigDecimal> This method returns a list of the weights of the Portfolio's contained assets.protected voidreset()voidsetConfidence(Comparable<?> aWeight) final voidsetRiskAversion(Comparable<?> factor) intsize()final List<SimpleAsset> final SimplePortfoliotoString()Methods inherited from class org.ojalgo.data.domain.finance.portfolio.FinancePortfolio
compareTo, forecast, getConformance, getLossProbability, getLossProbability, getSharpeRatio, getSharpeRatio, getValueAtRisk, getValueAtRisk95, getVolatility, normalise, normalise
-
Constructor Details
-
BlackLittermanModel
-
BlackLittermanModel
- Parameters:
marketEquilibrium- The covariance matrix, and market risk aversionoriginalWeights- The market portfolio
-
-
Method Details
-
addView
-
addViewWithBalancedConfidence
-
addViewWithScaledConfidence
public void addViewWithScaledConfidence(List<BigDecimal> someWeights, Comparable<?> aReturn, Comparable<?> aScale) -
addViewWithStandardDeviation
public void addViewWithStandardDeviation(List<BigDecimal> weights, BigDecimal expected, BigDecimal stdDev) -
getConfidence
"weight on views" or "tau" A parameter that describes the general confidence in the views. Typically set to sometghing between 0.0 and 1.0. 0.0 = "No confidence!" Why bother... 1.0 = As confident as the market. This is highly unlikely. -
setConfidence
- See Also:
-
calculateAssetReturns
-
calculateAssetWeights
-
getOriginalReturns
-
getOriginalWeights
- See Also:
-
getViewPortfolios
-
getViewReturns
Scaled by risk aversion factor. -
getViews
-
getViewVariances
Scaled by tau / weight on views -
calculatePortfolioReturn
- Specified by:
calculatePortfolioReturnin interfaceFinancePortfolio.Context
-
calculatePortfolioVariance
- Specified by:
calculatePortfolioVariancein interfaceFinancePortfolio.Context
-
getAssetReturns
- Specified by:
getAssetReturnsin interfaceFinancePortfolio.Context
-
getAssetVolatilities
- Specified by:
getAssetVolatilitiesin interfaceFinancePortfolio.Context
-
getAssetWeights
-
getCorrelations
- Specified by:
getCorrelationsin interfaceFinancePortfolio.Context
-
getCovariances
- Specified by:
getCovariancesin interfaceFinancePortfolio.Context
-
getMarketEquilibrium
-
getMeanReturn
public final double getMeanReturn()Description copied from class:FinancePortfolioThe mean/expected return of this instrument. May return either the absolute or excess return of the instrument. The context in which an instance is used should make it clear which. return.- Specified by:
getMeanReturnin classFinancePortfolio
-
getReturnVariance
public final double getReturnVariance()Description copied from class:FinancePortfolioThe instrument's return variance. Subclasses must override either FinancePortfolio.getReturnVariance() or FinancePortfolio.getVolatility().- Overrides:
getReturnVariancein classFinancePortfolio
-
getRiskAversion
-
getSymbols
-
getWeights
Description copied from class:FinancePortfolioThis method returns a list of the weights of the Portfolio's contained assets. An asset weight is NOT restricted to being a share/percentage - it can be anything. Most subclasses do however assume that the list of asset weights are shares/percentages that sum up to 100%. Calling FinancePortfolio.normalise() will transform any set of weights to that form.- Specified by:
getWeightsin classFinancePortfolio
-
setRiskAversion
-
size
public int size()- Specified by:
sizein interfaceFinancePortfolio.Context
-
toSimpleAssets
-
toSimplePortfolio
-
toString
- Overrides:
toStringin classFinancePortfolio
-
calculateAssetReturns
-
calculateAssetWeights
-
calculatePortfolioReturn
protected final Scalar<?> calculatePortfolioReturn(MatrixR064 aWeightsVctr, MatrixR064 aReturnsVctr) -
calculatePortfolioVariance
-
calibrate
-
reset
protected void reset()- Specified by:
resetin classFinancePortfolio
-