org.akutan.rbsa
Class RBSAExample

java.lang.Object
  extended by org.akutan.rbsa.RBSAExample

public class RBSAExample
extends java.lang.Object

This class implements and tests Return Based Style Analysis from William Sharpe. It makes use of the InteriorPointsSolver to perform the actual calculation. It also performs a simple least squares regression as a test.

Since:
8 March 2007

Constructor Summary
RBSAExample()
           
 
Method Summary
protected  cern.colt.matrix.DoubleMatrix2D getFactorReturns()
          Generate random factor returns
protected  cern.colt.matrix.DoubleMatrix2D getKnownFactors()
          Known repeatable returns for testing
protected  cern.colt.matrix.DoubleMatrix1D getKnownReturns(cern.colt.matrix.DoubleMatrix2D factors)
          Generates asset return from the factors without any randomness thrown in.
protected  cern.colt.matrix.DoubleMatrix1D getReturns(cern.colt.matrix.DoubleMatrix2D factors)
          Given the random factor returns generates a vector of returns with some random noise added.
static void main(java.lang.String[] args)
          Simple test program to try and compute the return based factor analysis of the asset against the factors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RBSAExample

public RBSAExample()
Method Detail

getReturns

protected cern.colt.matrix.DoubleMatrix1D getReturns(cern.colt.matrix.DoubleMatrix2D factors)
Given the random factor returns generates a vector of returns with some random noise added.

Parameters:
factors - Matrix of factor returns per date
Returns:
Vector of asset returns per date

getKnownReturns

protected cern.colt.matrix.DoubleMatrix1D getKnownReturns(cern.colt.matrix.DoubleMatrix2D factors)
Generates asset return from the factors without any randomness thrown in.

Parameters:
factors - Matrix of factor returns per date
Returns:
Vector of asset returns per date

getFactorReturns

protected cern.colt.matrix.DoubleMatrix2D getFactorReturns()
Generate random factor returns

Returns:
Matrix of returns by factor per date

getKnownFactors

protected cern.colt.matrix.DoubleMatrix2D getKnownFactors()
Known repeatable returns for testing

Returns:
Matrix of known factor returns per date

main

public static void main(java.lang.String[] args)
Simple test program to try and compute the return based factor analysis of the asset against the factors.

Parameters:
args -