org.akutan.optimization
Class SolvedPoint

java.lang.Object
  extended by org.akutan.optimization.SolvedPoint
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<SolvedPoint>

public class SolvedPoint
extends java.lang.Object
implements java.lang.Comparable<SolvedPoint>, java.lang.Cloneable


Field Summary
protected static java.text.DecimalFormat _df
           
protected  double _er
           
protected  java.util.List<double[]> _path
           
protected  double _sigma
           
protected  double _utility
           
protected  double[] _weights
           
 
Constructor Summary
SolvedPoint(double er, double sigma, double utility, double[] weights)
          Constructs
SolvedPoint(double er, double sigma, double utility, double[] weights, java.util.List<double[]> path)
          Constructs
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of the object
 int compareTo(SolvedPoint sp)
          Compares this solution to another solution
 double getEr()
          Returns the expected return of this solution/portfolio
 java.util.List<double[]> getPath()
          Returns the path of weights if one was saved
 double getSigma()
          Returns the standard deviation of this portfolio
 double getUtility()
          Returns the utility of the solution for this point
 double[] getWeights()
          Returns the weights of the various assets for this solution/portfolio
 void setEr(double er)
          Sets the expected return for this portfolio
 void setSigma(double sigma)
          Sets the standard deviation of the portfolio
 java.lang.String toString()
          Returns a formatted String representing the current state of this object for debugging
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_er

protected double _er

_sigma

protected double _sigma

_utility

protected double _utility

_weights

protected double[] _weights

_path

protected java.util.List<double[]> _path

_df

protected static java.text.DecimalFormat _df
Constructor Detail

SolvedPoint

public SolvedPoint(double er,
                   double sigma,
                   double utility,
                   double[] weights)
Constructs

Parameters:
er - Expected return for this portfolio
sigma - Standard deviation of returns for this portfolio
utility - Value of objective function (standard quadratic utility) for this portfolio
weights - Weights of the assets which defines this portfolio

SolvedPoint

public SolvedPoint(double er,
                   double sigma,
                   double utility,
                   double[] weights,
                   java.util.List<double[]> path)
Constructs

Parameters:
er - Expected return for this portfolio
sigma - Standard deviation of returns for this portfolio
utility - Value of objective function (standard quadratic utility) for this portfolio
weights - Weights of the assets which defines this portfolio
path - Path of weights taken to reach this solution
Method Detail

getEr

public double getEr()
Returns the expected return of this solution/portfolio

Returns:
Expected return of the portfolio

setEr

public void setEr(double er)
Sets the expected return for this portfolio

Parameters:
er - Expected return for the portfolio

getSigma

public double getSigma()
Returns the standard deviation of this portfolio

Returns:
Standard deviation of the portfolio

setSigma

public void setSigma(double sigma)
Sets the standard deviation of the portfolio

Parameters:
sigma - The standard deviation of the portfolio

getUtility

public double getUtility()
Returns the utility of the solution for this point

Returns:
The utility of this solution

getWeights

public double[] getWeights()
Returns the weights of the various assets for this solution/portfolio

Returns:
Array of the weights for each asset

getPath

public java.util.List<double[]> getPath()
Returns the path of weights if one was saved

Returns:
A list of the weights at each point along the path the optimizer too from the initial guess to this solution.

compareTo

public int compareTo(SolvedPoint sp)
Compares this solution to another solution

Specified by:
compareTo in interface java.lang.Comparable<SolvedPoint>
Parameters:
sp - The other solution
Returns:
-1 if less, 0 if equals, +1 if more
See Also:
Comparable.compareTo(Object)

toString

public java.lang.String toString()
Returns a formatted String representing the current state of this object for debugging

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object
See Also:
Object.toString()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a deep copy of the object

Overrides:
clone in class java.lang.Object
Returns:
Deep copy of this SolvedPoint
Throws:
java.lang.CloneNotSupportedException - If any sub-object cannot be cloned.
See Also:
Cloneable, Object.clone()