public class BrownianMotion extends StochasticProcess
In this class, this process is generated using the sequential (or random walk) technique: X(0) = x0 and
where Zj∼N(0, 1).path| Constructor and Description |
|---|
BrownianMotion(double x0,
double mu,
double sigma,
NormalGen gen)
Constructs a new BrownianMotion with parameters μ =
mu, σ = sigma and initial value
X(t0) = x0.
|
BrownianMotion(double x0,
double mu,
double sigma,
RandomStream stream)
Constructs a new BrownianMotion with
parameters μ = mu, σ = sigma and initial value
X(t0) = x0.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
generatePath()
Generates, returns, and saves the sample path
{X(t0), X(t1),…, X(td)}.
|
double[] |
generatePath(double[] uniform01)
Same as generatePath(), but a vector of uniform random numbers
must be provided to the method.
|
double[] |
generatePath(RandomStream stream)
Same as generatePath(), but first resets the stream to stream.
|
NormalGen |
getGen()
Returns the normal random variate generator used.
|
double |
getMu()
Returns the value of μ.
|
double |
getSigma()
Returns the value of σ.
|
RandomStream |
getStream()
Returns the random stream of the normal generator.
|
double |
nextObservation()
Generates and returns the next observation X(tj) of the stochastic process.
|
double |
nextObservation(double nextTime)
Generates and returns the next observation at time tj+1 =
nextTime.
|
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.
|
void |
setParams(double x0,
double mu,
double sigma)
Resets the parameters
X(t0) =
|
void |
setStream(RandomStream stream)
Resets the random stream of the normal generator to stream.
|
getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, resetStartProcess, setObservationTimes, setObservationTimes, setX0public BrownianMotion(double x0,
double mu,
double sigma,
RandomStream stream)
public BrownianMotion(double x0,
double mu,
double sigma,
NormalGen gen)
NormalGen is specified
directly instead of specifying the stream and using inversion.
The normal generator gen can use another method than inversion.public double nextObservation()
StochasticProcessnextObservation in class StochasticProcesspublic double nextObservation(double nextTime)
public double nextObservation(double x,
double dt)
public double[] generatePath()
StochasticProcessgeneratePath in class StochasticProcesspublic double[] generatePath(double[] uniform01)
public double[] generatePath(RandomStream stream)
StochasticProcessgeneratePath in class StochasticProcesspublic void setParams(double x0,
double mu,
double sigma)
public void setStream(RandomStream stream)
setStream in class StochasticProcesspublic RandomStream getStream()
getStream in class StochasticProcesspublic double getMu()
public double getSigma()
public NormalGen getGen()
RandomStream
used by that generator can be changed via
getGen().setStream(stream), for example.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.