|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.akutan.optimization.SimulatedAnnealing
public class SimulatedAnnealing
Class implements a simple Simulated Annealing algorithm from Chang et al, "Heuristics for Cardinality Constrained Portfolio Optimization", Computers & Operations Research, 27 (2000), 1271-1302.
| Field Summary | |
|---|---|
protected double |
_cMove
Initial relative move in an asset per iteration |
protected double |
_epsilon
Minimum required fraction for an asset in the solution |
protected double |
_moveSize
Current step |
protected cern.colt.matrix.DoubleMatrix1D |
_mu
Returns and covariances for the assets |
protected int |
_order
Number of assets required |
protected cern.jet.random.engine.RandomEngine |
_twister
Random engine shared across all activities |
protected cern.colt.matrix.DoubleMatrix2D |
_V
|
| Constructor Summary | |
|---|---|
SimulatedAnnealing(int order,
double epsilon,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix2D V)
Constructs a SimulatedAnnealing problem where the solution will have a number of active assets exactly equal to order. |
|
| Method Summary | |
|---|---|
SASolution |
anneal(double lambda)
Performs the simulated annealing optimization and returns a solution |
protected SASolution |
decide(SASolution s,
double lambda)
Original decision rule is random |
void |
dumpPoints()
Dumps out the list of solution points |
protected void |
evaluate(SASolution sl,
double lambda)
Called to evaluate a potential solution |
double |
getEpsilon()
Returns epsilon (min allocation to an asset) |
protected java.util.List<SASolution> |
initialGuess()
Constructs a set of initial crystals which represent potentially valid solutions. |
double |
move(SASolution s,
boolean up,
int ptr)
Called to move the specified asset up/down as directed |
java.util.List<SolvedPoint> |
solve(java.util.List<Constraint> constraints,
org.akutan.optimization.ProgressIndicator progress)
Called to solve for the efficient frontier subject to the constraints supplied by the caller. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int _order
protected double _epsilon
protected final double _cMove
protected double _moveSize
protected final cern.jet.random.engine.RandomEngine _twister
protected final cern.colt.matrix.DoubleMatrix1D _mu
protected final cern.colt.matrix.DoubleMatrix2D _V
| Constructor Detail |
|---|
public SimulatedAnnealing(int order,
double epsilon,
cern.colt.matrix.DoubleMatrix1D mu,
cern.colt.matrix.DoubleMatrix2D V)
order - Number of assets required in the solutionmu - Vector of expected returnsV - Covariance matrix of the assets| Method Detail |
|---|
protected java.util.List<SASolution> initialGuess()
public double getEpsilon()
protected void evaluate(SASolution sl,
double lambda)
sl - Potential solutionlambda - Used in the calculation of the scaling factor
public java.util.List<SolvedPoint> solve(java.util.List<Constraint> constraints,
org.akutan.optimization.ProgressIndicator progress)
solve in interface Solverconstraints - List of additional constraints
public SASolution anneal(double lambda)
lambda - Parameter to the simulated annealing algorithm
protected SASolution decide(SASolution s,
double lambda)
throws java.lang.CloneNotSupportedException
s - Solution to be examinedlambda - Parameter to the algorithm
java.lang.CloneNotSupportedException
public double move(SASolution s,
boolean up,
int ptr)
s - The solution in which the asset is to be movedup - true indicate increase the assets weightptr - Index of the asset to move
public void dumpPoints()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||