SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess Class Reference

This class is custom-made for the CallableBond example. More...

Inheritance diagram for umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess:
umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess umontreal.ssj.stochprocess.StochasticProcess

Public Member Functions

 OrnsteinUhlenbeckWithIntegratedProcess (double x0, double alpha, double b, double sigma, NormalGen gen)
double[] generatePath ()
 Same as the method from the parent class, but also generates at each time step a stochastic variable that corresponds to the integral of the process over the time interval: $\int_{t_{i-1}}^{t_{0}} X(t) dt$.
double[] getIntegratedPath ()
 This method must be called after generatePath() or nextObservation().
double[] getExpectedFutureDiscount (double[] couponTimes)
 generatePath must be called before this method is called since it depends on the underlying path.
double[] getTotalAnalyticDiscount (double[] times)
 This method is independent of the observation times of the object's instance, but it is dependent on the other parameters of the process.
Public Member Functions inherited from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess
 OrnsteinUhlenbeckProcess (double x0, double alpha, double b, double sigma, RandomStream stream)
 Constructs a new OrnsteinUhlenbeckProcess with parameters.
 OrnsteinUhlenbeckProcess (double x0, double alpha, double b, double sigma, NormalGen gen)
 Here, the normal variate generator is specified directly instead of specifying the stream.
double nextObservation ()
 Generates and returns the next observation \(X(t_j)\) of the stochastic process.
double nextObservation (double nextTime)
 Generates and returns the next observation at time \(t_{j+1} =\) nextTime, using the previous observation time \(t_j\) defined earlier (either by this method or by setObservationTimes), as well as the value of the previous observation \(X(t_j)\).
double nextObservation (double x, double dt)
 Generates an observation of the process in dt time units, assuming that the process has value \(x\) at the current time.
double[] generatePath (RandomStream stream)
 Generates a sample path of the process at all observation times, which are provided in array t.
void setParams (double x0, double alpha, double b, double sigma)
 Resets the parameters \(X(t_0) =\) x0, \(\alpha=\) alpha,.
void setStream (RandomStream stream)
 Resets the random stream of the normal generator to stream.
RandomStream getStream ()
 Returns the random stream of the normal generator.
double getAlpha ()
 Returns the value of \(\alpha\).
double getB ()
 Returns the value of \(b\).
double getSigma ()
 Returns the value of \(\sigma\).
NormalGen getGen ()
 Returns the normal random variate generator used.
Public Member Functions inherited from umontreal.ssj.stochprocess.StochasticProcess
void setObservationTimes (double[] T, int d)
 Sets the observation times of the process to a copy of T, with.
void setObservationTimes (double delta, int d)
 Sets equidistant observation times at \(t_j = j\delta\), for.
double[] getObservationTimes ()
 Returns a reference to the array that contains the observation times.
int getNumObservationTimes ()
 Returns the number \(d\) of observation times, excluding the time \(t_0\).
double[] getPath ()
 Returns a reference to the last generated sample path \(\{X(t_0), ... , X(t_d)\}\).
void getSubpath (double[] subpath, int[] pathIndices)
 Returns in subpath the values of the process at a subset of the observation times, specified as the times \(t_j\) whose indices.
double getObservation (int j)
 Returns \(X(t_j)\) from the current sample path.
void resetStartProcess ()
 Resets the observation counter to its initial value \(j=0\), so that the current observation \(X(t_j)\) becomes \(X(t_0)\).
boolean hasNextObservation ()
 Returns true if \(j<d\), where \(j\) is the number of observations of the current sample path generated since the last call to resetStartProcess.
int getCurrentObservationIndex ()
 Returns the value of the index \(j\) corresponding to the time.
double getCurrentObservation ()
 Returns the value of the last generated observation \(X(t_j)\).
double getX0 ()
 Returns the initial value \(X(t_0)\) for this process.
void setX0 (double s0)
 Sets the initial value \(X(t_0)\) for this process to s0, and reinitializes.
int[] getArrayMappingCounterToIndex ()
 Returns a reference to an array that maps an integer \(k\) to \(i_k\), the index of the observation \(S(t_{i_k})\) corresponding to the.

Protected Member Functions

void initArrays (int d)
 Sets up various constants and decomposes the correlation matrix at each time step.

Detailed Description

This class is custom-made for the CallableBond example.

It generates an Ornstein-Uhlenbeck process as in umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess, but it also computes the integral of the process, $\int_{t_0}^{t} X(\tau) d\tau$. The 2 x 2 correlation matrix for the process R(t) and its integral is decomposed with PCA.

Definition at line 16 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

Constructor & Destructor Documentation

◆ OrnsteinUhlenbeckWithIntegratedProcess()

umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.OrnsteinUhlenbeckWithIntegratedProcess ( double x0,
double alpha,
double b,
double sigma,
NormalGen gen )
Parameters
x0The starting value of the process.
alphaThe force pushing the process back to its average value, b.
bThe average value of the process.
sigmaThe volatility.

Definition at line 29 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

Member Function Documentation

◆ generatePath()

double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.generatePath ( )

Same as the method from the parent class, but also generates at each time step a stochastic variable that corresponds to the integral of the process over the time interval: $\int_{t_{i-1}}^{t_{0}} X(t) dt$.

Those integrated values are not returned by this method, but are stored in memory and can be retrieved with getIntegratedPath().

Two random uniforms (from the inner RandomStream) are required to generate each time step instead of just one for the parent class.

See also
getIntegratedPath()

Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.

Definition at line 87 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

◆ getExpectedFutureDiscount()

double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.getExpectedFutureDiscount ( double[] couponTimes)

generatePath must be called before this method is called since it depends on the underlying path.

Parameters
couponTimesThe times at which the coupons are disbursed, which are later (by noticePeriod) than the time at which the decisions are taken (the times used to generate the values in this class). couponTimes[0] is meaningless (no coupon). The order should correspond to the observation times of the process. If couponTimes has more elements than the number of time steps of the process, the expectation of those additional terms is computed relative to the last time step of the process.
Returns
$E[exp(-\int_{\tau_m}^{_0} R(t) dt) | R(\tau_m),\int_{\tau_m}^{_0} R(t) dt) ]$ where $\tau_m$ is one of the observationTimes of this StochasticProcess and $t_m$ is the corresponding couponTimes. $t_m$ should be larger than $\tau_m$ by one notice period. The first element of couponTimes and the returned array are meaningless; the returned value at [0] is 0.0.

Definition at line 134 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

◆ getIntegratedPath()

double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.getIntegratedPath ( )

This method must be called after generatePath() or nextObservation().

Returns
$\int_{\t_{0}}^{\t_{i}} X(\tau) d\tau$ for all (d + 1) time steps.

Definition at line 108 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

◆ getTotalAnalyticDiscount()

double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.getTotalAnalyticDiscount ( double[] times)

This method is independent of the observation times of the object's instance, but it is dependent on the other parameters of the process.

It returns an analytic discount, which is the averaging discount at each time step..

Parameters
timesThe times for which we want the total discounting (back to start time).
Returns
$E[exp(-\int_{t_0}^{t_m} R(t) dt) | R(t_0)]$ where $t_m$ is one of the observation times. The first element of the returned array is 1.0.

Definition at line 158 of file OrnsteinUhlenbeckWithIntegratedProcess.java.

◆ initArrays()

void umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.initArrays ( int d)
protected

Sets up various constants and decomposes the correlation matrix at each time step.

Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.

Definition at line 38 of file OrnsteinUhlenbeckWithIntegratedProcess.java.


The documentation for this class was generated from the following file: