- java.lang.Object
-
- org.ojalgo.data.domain.finance.portfolio.FinancePortfolio
-
- All Implemented Interfaces:
java.lang.Comparable<FinancePortfolio>
- Direct Known Subclasses:
BlackLittermanModel.View,EquilibriumModel,NormalisedPortfolio,SimpleAsset,SimplePortfolio
public abstract class FinancePortfolio extends java.lang.Object implements java.lang.Comparable<FinancePortfolio>
A FinancePortfolio is primarily a set of portfolio asset weights.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFinancePortfolio.Context
-
Field Summary
Fields Modifier and Type Field Description protected static MatrixR064.FactoryMATRIX_FACTORY
-
Constructor Summary
Constructors Modifier Constructor Description protectedFinancePortfolio()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(FinancePortfolio reference)GeometricBrownianMotionforecast()doublegetConformance(FinancePortfolio reference)doublegetLossProbability()doublegetLossProbability(java.lang.Number timePeriod)abstract doublegetMeanReturn()The mean/expected return of this instrument.doublegetReturnVariance()The instrument's return variance.doublegetSharpeRatio()doublegetSharpeRatio(java.lang.Number riskFreeReturn)doublegetValueAtRisk(java.lang.Number confidenceLevel, java.lang.Number timePeriod)Value at Risk (VaR) is the maximum loss not exceeded with a given probability defined as the confidence level, over a given period of time.doublegetValueAtRisk95()doublegetVolatility()Volatility refers to the standard deviation of the change in value of an asset with a specific time horizon.abstract java.util.List<java.math.BigDecimal>getWeights()This method returns a list of the weights of the Portfolio's contained assets.FinancePortfolionormalise()Normalised weights PortfolioFinancePortfolionormalise(NumberContext weightsContext)Normalised weights Portfolioprotected abstract voidreset()java.lang.StringtoString()
-
-
-
Field Detail
-
MATRIX_FACTORY
protected static final MatrixR064.Factory MATRIX_FACTORY
-
-
Method Detail
-
compareTo
public final int compareTo(FinancePortfolio reference)
- Specified by:
compareToin interfacejava.lang.Comparable<FinancePortfolio>
-
forecast
public final GeometricBrownianMotion forecast()
-
getConformance
public final double getConformance(FinancePortfolio reference)
-
getLossProbability
public final double getLossProbability()
-
getLossProbability
public final double getLossProbability(java.lang.Number timePeriod)
-
getMeanReturn
public abstract double getMeanReturn()
The 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.
-
getReturnVariance
public double getReturnVariance()
The instrument's return variance. Subclasses must override either getReturnVariance() or getVolatility().
-
getSharpeRatio
public final double getSharpeRatio()
-
getSharpeRatio
public final double getSharpeRatio(java.lang.Number riskFreeReturn)
-
getValueAtRisk
public final double getValueAtRisk(java.lang.Number confidenceLevel, java.lang.Number timePeriod)Value at Risk (VaR) is the maximum loss not exceeded with a given probability defined as the confidence level, over a given period of time.
-
getValueAtRisk95
public final double getValueAtRisk95()
-
getVolatility
public double getVolatility()
Volatility refers to the standard deviation of the change in value of an asset with a specific time horizon. It is often used to quantify the risk of the asset over that time period. Subclasses must override either getReturnVariance() or getVolatility().
-
getWeights
public abstract java.util.List<java.math.BigDecimal> getWeights()
This 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 normalise() will transform any set of weights to that form.
-
normalise
public final FinancePortfolio normalise()
Normalised weights Portfolio
-
normalise
public final FinancePortfolio normalise(NumberContext weightsContext)
Normalised weights Portfolio
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
reset
protected abstract void reset()
-
-