Class ExampleSDE
java.lang.Object
ch.epfl.lis.sde.Sde
ExampleSDE
public class ExampleSDE
- extends Sde
Function to test that integration works fine
dX = (-3X+1)dt + sigma*dW with X(0) = 1 (1)
with the exact solution
E(X) = 2/3*exp(-3t) + 1/3 (2)
Ito and Stratonovich drift terms are equal since sigma is constant. We
remember the Ito-Stratonovich drift conversion
Fu = F - 0.5*G*G'
where Fu is the drift term in Stratonovich scheme and G the diffusion term.
- Author:
- Thomas Schaffter (firstname.name@gmail.com)
Constructor Summary |
ExampleSDE()
Constructor that builds a system of 1 equations. |
ExampleSDE(int n)
Constructor that builds a system of n identical equations. |
Method Summary |
void |
getDriftAndDiffusion(double t,
cern.colt.matrix.DoubleMatrix1D Xin,
cern.colt.matrix.DoubleMatrix1D F,
cern.colt.matrix.DoubleMatrix2D G)
Computes the drift coefficients F and diffusion coefficient G at a given time. |
java.lang.String |
getId()
|
double |
getSigma()
|
void |
setId(java.lang.String id)
|
void |
setSigma(double sigma)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExampleSDE
public ExampleSDE()
- Constructor that builds a system of 1 equations.
ExampleSDE
public ExampleSDE(int n)
- Constructor that builds a system of n identical equations.
- Parameters:
n
- Dimension of the system
getDriftAndDiffusion
public void getDriftAndDiffusion(double t,
cern.colt.matrix.DoubleMatrix1D Xin,
cern.colt.matrix.DoubleMatrix1D F,
cern.colt.matrix.DoubleMatrix2D G)
throws java.lang.Exception
- Computes the drift coefficients F and diffusion coefficient G at a given time.
Note that Ito and Stratonovich drift terms are equivalent because the diffusion
term G is constant. See class description.
- Specified by:
getDriftAndDiffusion
in class Sde
- Throws:
java.lang.Exception
- If the scheme asked for is not implemented.
setSigma
public void setSigma(double sigma)
getSigma
public double getSigma()
setId
public void setId(java.lang.String id)
- Overrides:
setId
in class Sde
getId
public java.lang.String getId()
- Overrides:
getId
in class Sde