This class is custom-made for the CallableBond example. More...
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. | |
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.
| umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.OrnsteinUhlenbeckWithIntegratedProcess | ( | double | x0, |
| double | alpha, | ||
| double | b, | ||
| double | sigma, | ||
| NormalGen | gen ) |
| x0 | The starting value of the process. |
| alpha | The force pushing the process back to its average value, b. |
| b | The average value of the process. |
| sigma | The volatility. |
Definition at line 29 of file OrnsteinUhlenbeckWithIntegratedProcess.java.
| 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.
Reimplemented from umontreal.ssj.stochprocess.OrnsteinUhlenbeckProcess.
Definition at line 87 of file OrnsteinUhlenbeckWithIntegratedProcess.java.
| double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.getExpectedFutureDiscount | ( | double[] | couponTimes | ) |
generatePath must be called before this method is called since it depends on the underlying path.
| couponTimes | The 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. |
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.
| double[] umontreal.ssj.stochprocess.OrnsteinUhlenbeckWithIntegratedProcess.getIntegratedPath | ( | ) |
This method must be called after generatePath() or nextObservation().
Definition at line 108 of file OrnsteinUhlenbeckWithIntegratedProcess.java.
| 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..
| times | The times for which we want the total discounting (back to start time). |
Definition at line 158 of file OrnsteinUhlenbeckWithIntegratedProcess.java.
|
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.