org.akutan.blacklitterman
Class BLViews

java.lang.Object
  extended by org.akutan.blacklitterman.BLViews
All Implemented Interfaces:
java.lang.Cloneable

public class BLViews
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
protected  int _numAssets
           
protected  cern.colt.matrix.DoubleMatrix2D _o
           
protected  java.util.List<BLView> _views
           
 
Constructor Summary
BLViews(int numAssets)
          Constructs a container for views to be applied in the Black-Litterman model.
 
Method Summary
 void add(BLView view)
          Adds a view to the container.
 BLView get(int i)
          Returns a view from the container
 int getNumAssets()
          Number of assets
 cern.colt.matrix.DoubleMatrix2D makeO()
          Builds the O matrix from the views (variance of the views).
 cern.colt.matrix.DoubleMatrix2D makeP()
          Builds the pick matrix of the views (P)
 cern.colt.matrix.DoubleMatrix1D makeQ()
          Builds up the Q vector from the views (returns of the views)
 void setO(cern.colt.matrix.DoubleMatrix2D o)
          Sets the matrix of variance of the views for all views.
 int size()
          Returns the number of views
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_numAssets

protected int _numAssets

_views

protected java.util.List<BLView> _views

_o

protected cern.colt.matrix.DoubleMatrix2D _o
Constructor Detail

BLViews

public BLViews(int numAssets)
Constructs a container for views to be applied in the Black-Litterman model.

Parameters:
numAssets - Number of assets in the problem
Method Detail

add

public void add(BLView view)
Adds a view to the container.

Parameters:
view - Adds the specified view to the list of views to be applied

get

public BLView get(int i)
Returns a view from the container

Parameters:
i - Identifies the view
Returns:
The view specified

size

public int size()
Returns the number of views

Returns:
The number of views currently in the container.

getNumAssets

public int getNumAssets()
Number of assets

Returns:
The number of assets in the problem

setO

public void setO(cern.colt.matrix.DoubleMatrix2D o)
Sets the matrix of variance of the views for all views.

Parameters:
o - Matrix of variance of views to override
Throws:
java.lang.IllegalArgumentException - if the matrix of variances is not of the right size.

makeP

public cern.colt.matrix.DoubleMatrix2D makeP()
Builds the pick matrix of the views (P)

Returns:
The pick matrix of the views

makeQ

public cern.colt.matrix.DoubleMatrix1D makeQ()
Builds up the Q vector from the views (returns of the views)

Returns:
The vector of returns of the views.

makeO

public cern.colt.matrix.DoubleMatrix2D makeO()
Builds the O matrix from the views (variance of the views). If one is stored then it just returns that matrix, otherwise builds from the views.

Returns:
The variance of the views matrix.