24package umontreal.ssj.stochprocess;
26import umontreal.ssj.rng.*;
27import umontreal.ssj.probdist.*;
28import umontreal.ssj.randvar.*;
49 protected double[] mu, sigma;
50 protected double[] mudt;
79 super.setObservationTimes(t, d);
80 mbm.setObservationTimes(t, d);
83 public double[] nextObservationVector() {
97 throw new UnsupportedOperationException(
"nextObservationVector is not implemented ");
104 throw new UnsupportedOperationException(
"nextObservationVector is not implemented ");
108 for (
int i = 0; i < c; i++)
111 for (
int j = 1; j <= d; j++)
112 for (
int i = 0; i < c; i++)
113 path[c * j + i] = x0[i] * Math.exp(mbm.getObservation(j, i));
114 observationCounter = d;
123 observationCounter = 0;
124 mbm.resetStartProcess();
133 public void setParams(
int c,
double[] x0,
double[] mu,
double[] sigma) {
135 throw new IllegalArgumentException(
136 "x0 dimension : " + x0.length +
" is smaller than the process dimension : " + c);
138 throw new IllegalArgumentException(
139 "mu dimension : " + mu.length +
" is smaller than the process dimension : " + c);
140 if (sigma.length < c)
141 throw new IllegalArgumentException(
142 "sigma dimension : " + sigma.length +
" is smaller than the process dimension : " + c);
144 double[] zero =
new double[c];
147 this.mu =
new double[c];
148 for (
int i = 0; i < c; i++) {
149 this.mu[i] = mu[i] - 0.5 * sigma[i] * sigma[i];
152 mbm.setParams(zero, this.mu, sigma);
153 if (observationTimesSet)
168 return (mbm.gen).getStream();
186 protected void init() {
This class implements methods for generating random variates from the normal distribution .
This class represents a multivariate Brownian motion process.
void nextObservationVector(double[] obs)
Generates and returns the vector of next observations.
MultivariateBrownianMotion getBrownianMotion()
Returns a reference to the MultivariateBrownianMotion object used to generate the process.
void setParams(int c, double[] x0, double[] mu, double[] sigma)
Sets the parameters , and of the process.
void setStream(RandomStream stream)
Resets the random stream for the underlying Brownian motion to stream.
void setObservationTimes(double[] t, int d)
Sets the observation times of the MultivariateGeometricBrownianMotion, but also those of the inner.
RandomStream getStream()
Returns the random stream for the underlying Brownian motion.
void resetStartProcess()
Same as in StochasticProcess, but also invokes resetStartProcess for the underlying BrownianMotion ob...
MultivariateGeometricBrownianMotion(int c, double[] x0, double[] mu, double[] sigma, MultivariateBrownianMotion mbm)
Constructs a new MultivariateGeometricBrownianMotion with parameters , , and , using mbm as the under...
NormalGen getGen()
Returns the normal random variate generator used.
double[] generatePath()
Generates, returns, and saves the sample path.
This class is a multivariate version of StochasticProcess where the process evolves in the -dimension...
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...