org.jquantlib.processes
Class StochasticProcess
- java.lang.Object
-
- org.jquantlib.processes.StochasticProcess
-
- All Implemented Interfaces:
- Observable, Observer
- Direct Known Subclasses:
- ForwardMeasureProcess, HestonProcess, LiborForwardModelProcess, StochasticProcess1D, StochasticProcessArray
public abstract class StochasticProcess extends java.lang.Object implements Observable, Observer
Multi-dimensional stochastic process class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interfaceStochasticProcess.DiscretizationDiscretization of a stochastic process over a given time interval
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddObserver(Observer observer)Attaches a observer to the Observable.Arrayapply(Array x0, Array dx)Applies a change to the asset value.intcountObservers()Counts how many Observers were attached to this class.Matrixcovariance(double t0, Array x0, double dt)Returns the covariance of the process after a time interval according to the given discretization.voiddeleteObserver(Observer observer)Detaches a previously attached observer to the observable.voiddeleteObservers()Detaches all previously attached observer to the observable.abstract Matrixdiffusion(double t, Array x)Returns the diffusion part of the equation, i.e.abstract Arraydrift(double t, Array x)Returns the drift part of the equation, i.e.,Arrayevolve(double t0, Array x0, double dt, Array dw)Returns the asset value after a time interval according to the given discretization.Arrayexpectation(double t0, Array x0, double dt)Returns the expectation of the process after a time interval according to the given discretization.intfactors()Returns the number of independent factors of the processjava.util.List<Observer>getObservers()Returns list of observers registered with the Observable.abstract ArrayinitialValues()Returns the initial values of the state variablesvoidnotifyObservers()Notifies all attached observers about changes in the observable.voidnotifyObservers(java.lang.Object arg)Notifies all attached observers about changes in the observable.abstract intsize()Returns the number of dimensions of the stochastic processMatrixstdDeviation(double t0, Array x0, double dt)Returns the standard deviation of the process after a time interval according to the given discretization.doubletime(Date date)Returns the time value corresponding to the given date in the reference system of the stochastic process.voidupdate()This method is called whenever the observed object is changed.
-
-
-
Method Detail
-
size
public abstract int size()
Returns the number of dimensions of the stochastic process
-
factors
public int factors()
Returns the number of independent factors of the process
-
initialValues
public abstract Array initialValues()
Returns the initial values of the state variables
-
diffusion
public abstract Matrix diffusion(double t, Array x)
Returns the diffusion part of the equation, i.e.
-
expectation
public Array expectation(double t0, Array x0, double dt)
Returns the expectation of the process after a time interval according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
-
stdDeviation
public Matrix stdDeviation(double t0, Array x0, double dt)
Returns the standard deviation of the process after a time interval according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
-
covariance
public Matrix covariance(double t0, Array x0, double dt)
Returns the covariance of the process after a time interval according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
-
evolve
public Array evolve(double t0, Array x0, double dt, Array dw)
Returns the asset value after a time interval according to the given discretization. By default, it returns where is the expectation and the standard deviation.
-
time
public double time(Date date)
Returns the time value corresponding to the given date in the reference system of the stochastic process.
-
update
public void update()
Description copied from interface:ObserverThis method is called whenever the observed object is changed.
-
addObserver
public void addObserver(Observer observer)
Description copied from interface:ObservableAttaches a observer to the Observable. After attachment the observer gets informed about changes in the Observable.- Specified by:
addObserverin interfaceObservable- Parameters:
observer- The observer to attach to the observable
-
countObservers
public int countObservers()
Description copied from interface:ObservableCounts how many Observers were attached to this class.- Specified by:
countObserversin interfaceObservable- Returns:
- the number of Observers
- See Also:
Observer
-
deleteObserver
public void deleteObserver(Observer observer)
Description copied from interface:ObservableDetaches a previously attached observer to the observable. After detachment the observer does no longer receive change notifications from the observable.- Specified by:
deleteObserverin interfaceObservable- Parameters:
observer- The observer to detach from the observable
-
notifyObservers
public void notifyObservers()
Description copied from interface:ObservableNotifies all attached observers about changes in the observable.- Specified by:
notifyObserversin interfaceObservable
-
notifyObservers
public void notifyObservers(java.lang.Object arg)
Description copied from interface:ObservableNotifies all attached observers about changes in the observable.- Specified by:
notifyObserversin interfaceObservable- Parameters:
arg- an arbitrary Object to be passed to the Observer
-
deleteObservers
public void deleteObservers()
Description copied from interface:ObservableDetaches all previously attached observer to the observable. After detachment observers do not longer receive change notifications from the observable.- Specified by:
deleteObserversin interfaceObservable
-
getObservers
public java.util.List<Observer> getObservers()
Description copied from interface:ObservableReturns list of observers registered with the Observable. List returned is unmodifiable list.- Specified by:
getObserversin interfaceObservable- Returns:
- list of observers
-
-
DataMelt 3.0 © DataMelt by jWork.ORG