Processes Class StochasticProcess

java.lang.Object Processes.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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.7130039,"math_prob":0.9313103,"size":6112,"snap":"2019-43-2019-47","text_gpt3_token_len":1506,"char_repetition_ratio":0.14079896,"word_repetition_ratio":0.4275996,"special_character_ratio":0.25359946,"punctuation_ratio":0.13148789,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9812392,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-22T04:56:38Z\",\"WARC-Record-ID\":\"<urn:uuid:590152d9-c992-49b0-af1d-ac7f2d1747c3>\",\"Content-Length\":\"23192\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3cab29e3-fac5-4630-a7c3-89a6c7327bf5>\",\"WARC-Concurrent-To\":\"<urn:uuid:610b0458-a41c-4a4d-bdf7-dc8a7fbba039>\",\"WARC-IP-Address\":\"81.170.169.189\",\"WARC-Target-URI\":\"http://janroman.dhis.org/finance/martingale-dist/javadoc/Processes/StochasticProcess.html\",\"WARC-Payload-Digest\":\"sha1:FN2DZH3QXNXN6YJIFVJLAEU2V6GPISTQ\",\"WARC-Block-Digest\":\"sha1:UFS3YFHWZWQNTYNCOMRBTSSL4L47DEK2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570987798619.84_warc_CC-MAIN-20191022030805-20191022054305-00129.warc.gz\"}"}