org.akutan.optimization
Class SimulationSolver

java.lang.Object
  extended by org.akutan.optimization.SimulationSolver
All Implemented Interfaces:
Solver

public class SimulationSolver
extends java.lang.Object
implements Solver

This class encapsulates the simulation method described in the Farrely article from Journal of Investing, Winter 2006. It basically simulates the assets, compares portfolios to efficient frontiers and then builds a new efficient frontier.

Since:
28 June 2007

Field Summary
protected  int _scenarios
           
protected  java.text.DecimalFormat df
           
protected  cern.colt.matrix.DoubleMatrix1D e_rx
           
protected  cern.colt.matrix.DoubleMatrix2D V
           
 
Constructor Summary
SimulationSolver(int scenarios, cern.colt.matrix.DoubleMatrix1D e_r, cern.colt.matrix.DoubleMatrix2D V_p)
          Constructs
 
Method Summary
 double distance(cern.colt.matrix.DoubleMatrix1D eR, cern.colt.matrix.DoubleMatrix1D rW, cern.colt.matrix.DoubleMatrix1D w, double lambda)
          Computes the distance between a reference portfolio (rW) and a test portfolio (w) for a given set of returns (eR) and a given lambda value.
 cern.colt.matrix.DoubleMatrix1D getOneReturn()
          Called to get the return vector for one simulated return scenario, given that the returns are normally distributed with mean e_rx and variance V.
 java.util.List<SolvedPoint> solve(java.util.List<Constraint> constraints, org.akutan.optimization.ProgressIndicator progress)
          Evaluates the objective function across scenarios for a specific candidate solution.
 java.util.List<SolvedPoint> solveScenario(java.util.List<Constraint> constraints, org.akutan.optimization.ProgressIndicator progress)
          Called to solve for the efficient frontier for a given scenario
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

df

protected final java.text.DecimalFormat df

_scenarios

protected int _scenarios

e_rx

protected cern.colt.matrix.DoubleMatrix1D e_rx

V

protected cern.colt.matrix.DoubleMatrix2D V
Constructor Detail

SimulationSolver

public SimulationSolver(int scenarios,
                        cern.colt.matrix.DoubleMatrix1D e_r,
                        cern.colt.matrix.DoubleMatrix2D V_p)
Constructs

Parameters:
scenarios - Number of scenarios to use
e_r - vector of asset expected returns
V_p - Covariance matrix for assets
Method Detail

distance

public double distance(cern.colt.matrix.DoubleMatrix1D eR,
                       cern.colt.matrix.DoubleMatrix1D rW,
                       cern.colt.matrix.DoubleMatrix1D w,
                       double lambda)
Computes the distance between a reference portfolio (rW) and a test portfolio (w) for a given set of returns (eR) and a given lambda value.

Parameters:
eR - Expected returns
rW - Reference portfolio weights
w - Test portfolio weights
lambda - exponent
Returns:
norm between reference portfolio and test portfolio

getOneReturn

public cern.colt.matrix.DoubleMatrix1D getOneReturn()
Called to get the return vector for one simulated return scenario, given that the returns are normally distributed with mean e_rx and variance V.

Returns:
vector of asset returns

solveScenario

public java.util.List<SolvedPoint> solveScenario(java.util.List<Constraint> constraints,
                                                 org.akutan.optimization.ProgressIndicator progress)
Called to solve for the efficient frontier for a given scenario

Parameters:
constraints - List of constraints to be applied to the problem
Returns:
List of points on the efficient frontier for this scenario

solve

public java.util.List<SolvedPoint> solve(java.util.List<Constraint> constraints,
                                         org.akutan.optimization.ProgressIndicator progress)
Evaluates the objective function across scenarios for a specific candidate solution.

Specified by:
solve in interface Solver
Parameters:
constraints - List of constraints to be applied to the problem
Returns:
List of points on the efficient frontier