ch.epfl.lis.sde.solver
Class SdeSolver

java.lang.Object
  extended by ch.epfl.lis.sde.solver.SdeSolver
Direct Known Subclasses:
EulerHeun, EulerMaruyama, MilsteinIto, MilsteinStratonovich, SRK15

public abstract class SdeSolver
extends java.lang.Object

This class serves as basis for the implementation of a SDE solver.

Author:
Thomas Schaffter (firstname.name@gmail.com)

Constructor Summary
SdeSolver()
          Default constructor
 
Method Summary
abstract  void advance(double t, double h, cern.colt.matrix.DoubleMatrix1D dW, cern.colt.matrix.DoubleMatrix1D dZ, cern.colt.matrix.DoubleMatrix1D Xin, cern.colt.matrix.DoubleMatrix1D Xout)
          Proceed on iteration of the numerical integration (step size = h)
 void checkConvergence(cern.colt.matrix.DoubleMatrix1D X)
          This function checks the convergence of the system.
 void checkX(cern.colt.matrix.DoubleMatrix1D X)
          This function can be overwrite if a check as to be performed on X at every step()
 boolean converged()
           
 void generateW()
          At each step(), W must be regenerated.
 void generateWienerIncrements(int n, cern.colt.matrix.DoubleMatrix1D dW, cern.colt.matrix.DoubleMatrix1D dZ)
          For Euler and Milstein method, on dW is required.
 void generateWZ()
          At each step(), regenerate W and Z (Z are useful for Runge-Kutta of strong order >= 1.5).
 double getAbsolutePrecision()
           
 java.lang.String getDescription()
          Returns the description of this solver.
 double getH()
           
 double getRelativePrecision()
           
 Sde getSystem()
           
 cern.colt.matrix.DoubleMatrix1D getX()
           
 void init()
          Must be call after the SDE parameterized and associated to this solver.
 cern.colt.matrix.DoubleMatrix1D integrate()
          Little function to integrate a SDE.
 void reset()
          Cleanup the solver
 void setAbsolutePrecision(double value)
           
 void setH(double H)
           
 void setRelativePrecision(double value)
           
 void setSystem(Sde sde)
           
 void setX(cern.colt.matrix.DoubleMatrix1D X)
           
 double step()
          Step the integration from the current time t1 to t1+H_, return H_.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SdeSolver

public SdeSolver()
Default constructor

Method Detail

advance

public abstract void advance(double t,
                             double h,
                             cern.colt.matrix.DoubleMatrix1D dW,
                             cern.colt.matrix.DoubleMatrix1D dZ,
                             cern.colt.matrix.DoubleMatrix1D Xin,
                             cern.colt.matrix.DoubleMatrix1D Xout)
                      throws java.lang.Exception
Proceed on iteration of the numerical integration (step size = h)

Throws:
java.lang.Exception

reset

public void reset()
Cleanup the solver


generateW

public void generateW()
At each step(), W must be regenerated.


generateWZ

public void generateWZ()
At each step(), regenerate W and Z (Z are useful for Runge-Kutta of strong order >= 1.5).


init

public void init()
Must be call after the SDE parameterized and associated to this solver. The correct seed and all the SdeSettings parameters must also have been set.


step

public double step()
            throws java.lang.Exception
Step the integration from the current time t1 to t1+H_, return H_.

Throws:
java.lang.Exception

generateWienerIncrements

public void generateWienerIncrements(int n,
                                     cern.colt.matrix.DoubleMatrix1D dW,
                                     cern.colt.matrix.DoubleMatrix1D dZ)
For Euler and Milstein method, on dW is required. Overwrite this function if dW is required (e.g. SRK methods)


checkX

public void checkX(cern.colt.matrix.DoubleMatrix1D X)
This function can be overwrite if a check as to be performed on X at every step()


checkConvergence

public void checkConvergence(cern.colt.matrix.DoubleMatrix1D X)
This function checks the convergence of the system. If yes, set converged_ = true.


getDescription

public java.lang.String getDescription()
Returns the description of this solver.


integrate

public cern.colt.matrix.DoubleMatrix1D integrate()
                                          throws java.lang.Exception
Little function to integrate a SDE. Returns the solution X at t=maxt NOTE: If you want to save the state of X at different time points between t=0 and t=maxt, you must redefine this function. See TimeSeriesExepriment.java

Throws:
java.lang.Exception

setSystem

public void setSystem(Sde sde)

getSystem

public Sde getSystem()

setX

public void setX(cern.colt.matrix.DoubleMatrix1D X)

getX

public cern.colt.matrix.DoubleMatrix1D getX()

setH

public void setH(double H)

getH

public double getH()

setAbsolutePrecision

public void setAbsolutePrecision(double value)

getAbsolutePrecision

public double getAbsolutePrecision()

setRelativePrecision

public void setRelativePrecision(double value)

getRelativePrecision

public double getRelativePrecision()

converged

public boolean converged()