Class BrownianMotionBridge
- java.lang.Object
-
- umontreal.iro.lecuyer.stochprocess.StochasticProcess
-
- umontreal.iro.lecuyer.stochprocess.BrownianMotion
-
- umontreal.iro.lecuyer.stochprocess.BrownianMotionBridge
-
public class BrownianMotionBridge extends BrownianMotion
Represents a Brownian motion process {X(t) : t >= 0} sampled using the bridge sampling technique (see for example). This technique generates first the value X(td) at the last observation time, then the value at time td/2 (or the nearest integer), then the values at time td/4 and at time t3d/4 (or the nearest integers), and so on. If the process has already been sampled at times ti < tk but not in between, the next sampling point in that interval will be tj where j = floor((i + k)/2). For example, if the sampling times used are { t0, t1, t2, t3, t4, t5}, then the observations are generated in the following order: X(t5), X(t2), X(t1), X(t3), X(t4).Warning: Both the generatePath and the nextObservation methods from
BrownianMotionare modified to use the bridge method. In the case of nextObservation, the user should understand that the observations returned are not ordered chronologically. However they will be once an entire path is generated and the observations are read from the internal array (referenced by the getPath method) that contains them.The method nextObservation(double nextTime) differs from that of the class
BrownianMotionin that nextTime represents the next observation time of the Brownian bridge. However, the ti supplied must still be non-decreasing with i.Note also that, if the path is not entirely generated before being read from this array, there will be ``pollution'' from the previous path generated, and the observations will not represent a sample path of this process.
-
-
Constructor Summary
Constructors Constructor and Description BrownianMotionBridge(double x0, double mu, double sigma, NormalGen gen)Constructs a new BrownianMotionBridge with parameters μ =mu , σ =sigma and initial value X(t0) =x0 .BrownianMotionBridge(double x0, double mu, double sigma, RandomStream stream)Constructs a new BrownianMotionBridge with parameters μ =mu , σ =sigma and initial value X(t0) =x0 .
-
Method Summary
All Methods Instance Methods Concrete Methods 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.doublenextObservation()Generates and returns the next observation X(tj) of the stochastic process.doublenextObservation(double nextTime)Generates and returns the next observation at time tj+1 = nextTime.voidresetStartProcess()Resets the observation counter to its initial value j = 0, so that the current observation X(tj) becomes X(t0).-
Methods inherited from class umontreal.iro.lecuyer.stochprocess.BrownianMotion
generatePath, getGen, getMu, getSigma, getStream, nextObservation, setParams, setStream
-
Methods inherited from class umontreal.iro.lecuyer.stochprocess.StochasticProcess
getArrayMappingCounterToIndex, getCurrentObservation, getCurrentObservationIndex, getNbObservationTimes, getObservation, getObservationTimes, getPath, getSubpath, getX0, hasNextObservation, setObservationTimes, setObservationTimes, setX0
-
-
-
-
Constructor Detail
-
BrownianMotionBridge
public BrownianMotionBridge(double x0, double mu, double sigma, RandomStream stream)Constructs a new BrownianMotionBridge with parameters μ =mu , σ =sigma and initial value X(t0) =x0 . The normal variates will be generated by inversion using theRandomStreamstream.
-
-
Method Detail
-
nextObservation
public double nextObservation()
Description copied from class:StochasticProcessGenerates and returns the next observation X(tj) of the stochastic process. The processes are usually sampled sequentially, i.e. if the last observation generated was for time tj-1, the next observation returned will be for time tj. In some cases, subclasses extending this abstract class may use non-sequential sampling algorithms (such as bridge sampling). The order of generation of the tj's is then specified by the subclass. All the processes generated using principal components analysis (PCA) do not have this method.- Overrides:
nextObservationin classBrownianMotion
-
nextObservation
public double nextObservation(double nextTime)
Description copied from class:BrownianMotionGenerates and returns the next observation at time tj+1 = nextTime. It uses the previous observation time tj defined earlier (either by this method or by setObservationTimes), as well as the value of the previous observation X(tj). Warning: This method will reset the observations time tj+1 for this process to nextTime. The user must make sure that the tj+1 supplied is >= tj.- Overrides:
nextObservationin classBrownianMotion
-
generatePath
public double[] generatePath()
Description copied from class:StochasticProcessGenerates, returns, and saves the sample path {X(t0), X(t1),…, X(td)}. It can then be accessed via getPath, getSubpath, or getObservation. The generation method depends on the process type.- Overrides:
generatePathin classBrownianMotion
-
generatePath
public double[] generatePath(double[] uniform01)
Description copied from class:BrownianMotionSame as generatePath(), but a vector of uniform random numbers must be provided to the method. These uniform random numbers are used to generate the path.- Overrides:
generatePathin classBrownianMotion
-
resetStartProcess
public void resetStartProcess()
Description copied from class:StochasticProcessResets the observation counter to its initial value j = 0, so that the current observation X(tj) becomes X(t0). This method should be invoked before generating observations sequentially one by one vianextObservation, for a new sample path.- Overrides:
resetStartProcessin classStochasticProcess
-
-
DMelt 3.0 © DataMelt by jWork.ORG