Processes
Class StochasticProcess

java.lang.Object
  extended byProcesses.StochasticProcess
Direct Known Subclasses:
BiasedRandomWalk, BrownianMotion, CompoundPoissonProcess, MarkovChain, SymmetricRandomWalk

public abstract class StochasticProcess
extends java.lang.Object

Abstract class implementing some methods for a one dimensional * stochastic process and leaving process specific details abstract to be * overridden in concrete subclasses.

* *

The only abstract method is timeStep(int). All other methods provide * default implementations. If you want a concrete one dimensional * stochastic process all you need to do is to subclass from StochasticProcess * and to define this one method or to call the constructor and to define the * method in the body of the constructor call.

* *

Path computation: the basic procedure is to continue a path which * has already been realized until time t from this time t to the horizon * (branching at time t). * Here we are simulating future scenarios conditional on the state at time t. * This is what is needed for the computation of conditional expectations * conditioning on all information available at time t. The computation of * entire paths is then merely a continuation from time t=0.

* *

Time is measured in discrete units (the time step dt). Integer time t * corresponds to continuous time t*dt. The case dt=1 is the special case of a * sequential stochastic process.

* * @author Michael J. Meyer


Constructor Summary
StochasticProcess(int T, double dt, double X_0)
          Constructor performing all initializations but leaving the abstract * method timeStep(int) undefined.
 
Method Summary
 double get_dt()
          Size of time step.
 double[] get_path()
          Reference to array path containing the path of (this) * process X, path[t]=X(t*dt).
 int get_T()
          Number of time steps to horizon.
 double get_X_0()
          Initial value X(0).
 void newPath()
          Computes a new path from time t=0.
 void newPathBranch(int t)
          Continues a path existing on [0,t] from time t to * the horizon, that is, computes path[s], s=t+1,...,T from path[u], u<=t * (branching a path at time t).
 void pathSegment(int t, int s)
          Computes a new path segment from time t to time s through all * intermediate times t+1,...,s-1.
 int pathSegment(int t, StoppingTime tau)
          Computes a new path segment from time t to the random time tau>=t * and returns the value of the time tau >= t when the path is stopped.
 int pathSegment(StoppingTime tau)
          Computes a new path segment from time t=0 to the random time tau and * returns the value of the time tau when the path is stopped.
 RandomVariable sampledAt(StoppingTime tau)
          Computes the random variable X_tau, that is, X sampled at the * stopping time tau, where X denotes the current stochastic process * (this).
 void simulationInit(int t)
          Sets up a path simulation (t=0) or a simulation of * branches of an existing path (t>0, conditional expectations).
abstract  void timeStep(int t)
          Evolves a path from discrete time [0,t] to time t+1, that is, * computes path[t+1] from path[u], u<=t.
 void timeStep(int t, int s)
          Computes path[s] from path[u], u<=t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StochasticProcess

public StochasticProcess(int T,
                         double dt,
                         double X_0)

Constructor performing all initializations but leaving the abstract * method timeStep(int) undefined. Instantiate a StochasticProcess by * defining this method in the body of the constructor call.

* * @param T number of time steps to horizon. * @param dt size of time step. * @param X_0 initial value X(0).

Method Detail

get_T

public int get_T()

Number of time steps to horizon.


get_dt

public double get_dt()

Size of time step.


get_X_0

public double get_X_0()

Initial value X(0).


get_path

public double[] get_path()

Reference to array path containing the path of (this) * process X, path[t]=X(t*dt).


simulationInit

public void simulationInit(int t)

Sets up a path simulation (t=0) or a simulation of * branches of an existing path (t>0, conditional expectations). * Default: empty, nothing to do.

* * @param current time.


timeStep

public abstract void timeStep(int t)

Evolves a path from discrete time [0,t] to time t+1, that is, * computes path[t+1] from path[u], u<=t.

* * @param current time.


newPathBranch

public void newPathBranch(int t)

Continues a path existing on [0,t] from time t to * the horizon, that is, computes path[s], s=t+1,...,T from path[u], u<=t * (branching a path at time t).

* * Default implementation: calls to timeStep. * This is not the most efficient method, override if fastest * path computation is a concern. * * @param t time of branching.


newPath

public void newPath()

Computes a new path from time t=0.


timeStep

public void timeStep(int t,
                     int s)

Computes path[s] from path[u], u<=t.

* *

Sometimes this can be accomplished in a single step without stepping * through intermediate times t+1,...,s-1. In this case path computations * can often be sped up by sampling the path only at the times s which are * needed.

* *

Default implementation: individual time steps, no efficiency gain. * This is meant to be overridden where possible but a default is * provided for convenience.

* * @param t current time. * @param s future time.


pathSegment

public void pathSegment(int t,
                        int s)

Computes a new path segment from time t to time s through all * intermediate times t+1,...,s-1. It is assumed that a path has been * computed up to time t. * Default implementation: calls to timeStep.

* * @param t current time. * @param s future time.


pathSegment

public int pathSegment(int t,
                       StoppingTime tau)

Computes a new path segment from time t to the random time tau>=t * and returns the value of the time tau >= t when the path is stopped. * Default implementation: calls to timeStep.

* * @param t current time * @param tau random future time


pathSegment

public int pathSegment(StoppingTime tau)

Computes a new path segment from time t=0 to the random time tau and * returns the value of the time tau when the path is stopped. * Default implementation: calls to timeStep.

* * @param tau random time when path is stopped.


sampledAt

public RandomVariable sampledAt(StoppingTime tau)

Computes the random variable X_tau, that is, X sampled at the * stopping time tau, where X denotes the current stochastic process * (this).

* * @param tau stopping time at which X is sampled.