org.ojalgo.finance.portfolio
Class SimplePortfolio

java.lang.Object
  extended by org.ojalgo.finance.portfolio.FinancePortfolio
      extended by org.ojalgo.finance.portfolio.SimplePortfolio
All Implemented Interfaces:
Comparable<FinancePortfolio>, PortfolioContext

public final class SimplePortfolio
extends FinancePortfolio
implements PortfolioContext


Constructor Summary
SimplePortfolio(Access2D<?> aCorrelationsMatrix, List<SimpleAsset> someAssets)
          Deprecated. v32 Use SimplePortfolio(BasicMatrix, List) instead.
SimplePortfolio(BasicMatrix correlationsMatrix, List<SimpleAsset> someAssets)
           
SimplePortfolio(List<SimpleAsset> someAssets)
           
SimplePortfolio(Number... someWeights)
           
SimplePortfolio(PortfolioContext aContext, FinancePortfolio weightsPortfolio)
           
 
Method Summary
 double calculatePortfolioReturn(FinancePortfolio weightsPortfolio)
           
 double calculatePortfolioVariance(FinancePortfolio weightsPortfolio)
           
 BasicMatrix getAssetReturns()
           
 double getCorrelation(int aRow, int aCol)
           
 BasicMatrix getCorrelations()
           
 double getCovariance(int aRow, int aCol)
           
 BasicMatrix getCovariances()
           
 double getMeanReturn()
          The mean/expected return of this instrument.
 double getMeanReturn(int index)
           
 double getReturnVariance()
          The instrument's return variance.
 double getReturnVariance(int index)
           
 PortfolioSimulator getSimulator()
           
 double getVolatility(int index)
           
 BigDecimal getWeight(int index)
           
 List<BigDecimal> getWeights()
          This method returns a list of the weights of the Portfolio's contained assets.
 
Methods inherited from class org.ojalgo.finance.portfolio.FinancePortfolio
compareTo, forecast, getConformance, getMeanReturn, getReturnOverVariance, getReturnVariance, getSharpeRatio, getSharpeRatio, getValueAtRisk, getValueAtRisk95, getVarianceOverReturn, getVolatility, getVolatility, normalise, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimplePortfolio

@Deprecated
public SimplePortfolio(Access2D<?> aCorrelationsMatrix,
                                  List<SimpleAsset> someAssets)
Deprecated. v32 Use SimplePortfolio(BasicMatrix, List) instead.


SimplePortfolio

public SimplePortfolio(BasicMatrix correlationsMatrix,
                       List<SimpleAsset> someAssets)

SimplePortfolio

public SimplePortfolio(List<SimpleAsset> someAssets)

SimplePortfolio

public SimplePortfolio(Number... someWeights)

SimplePortfolio

public SimplePortfolio(PortfolioContext aContext,
                       FinancePortfolio weightsPortfolio)
Method Detail

calculatePortfolioReturn

public double calculatePortfolioReturn(FinancePortfolio weightsPortfolio)
Specified by:
calculatePortfolioReturn in interface PortfolioContext

calculatePortfolioVariance

public double calculatePortfolioVariance(FinancePortfolio weightsPortfolio)
Specified by:
calculatePortfolioVariance in interface PortfolioContext

getAssetReturns

public BasicMatrix getAssetReturns()
Specified by:
getAssetReturns in interface PortfolioContext

getCorrelation

public double getCorrelation(int aRow,
                             int aCol)

getCorrelations

public BasicMatrix getCorrelations()
Specified by:
getCorrelations in interface PortfolioContext

getCovariance

public double getCovariance(int aRow,
                            int aCol)

getCovariances

public BasicMatrix getCovariances()
Specified by:
getCovariances in interface PortfolioContext

getMeanReturn

public double getMeanReturn()
Description copied from class: FinancePortfolio
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. Calling #shift(Number) with an appropriate argument will transform between absolute and excess return.

Specified by:
getMeanReturn in class FinancePortfolio

getMeanReturn

public double getMeanReturn(int index)

getReturnVariance

public double getReturnVariance()
Description copied from class: FinancePortfolio
The instrument's return variance. Subclasses must override either FinancePortfolio.getReturnVariance() or FinancePortfolio.getVolatility().

Overrides:
getReturnVariance in class FinancePortfolio

getReturnVariance

public double getReturnVariance(int index)

getSimulator

public PortfolioSimulator getSimulator()

getVolatility

public double getVolatility(int index)

getWeight

public BigDecimal getWeight(int index)

getWeights

public List<BigDecimal> getWeights()
Description copied from class: FinancePortfolio
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 FinancePortfolio.normalise() will transform any set of weights to that form.

Specified by:
getWeights in class FinancePortfolio