You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We simulate a flow of $1000$ trajectories, with integration step size $\Delta t = 0.001$, and $x_0 = 3$ at time $t_0 = 0$, $y = 1$ at terminal time $T=1$.
79
79
80
80
```{r}
81
+
set.seed(1234, kind = "L'Ecuyer-CMRG")
81
82
f <- expression((1-x)/(1-t))
82
83
g <- expression(x)
83
84
mod <- bridgesde1d(drift=f,diffusion=g,x0=3,y=1,M=1000)
@@ -134,6 +135,7 @@ $$
134
135
We simulate a flow of $1000$ trajectories, with integration step size $\Delta t = 0.01$:
1. Bladt, M. and Sorensen, M. (2007). Simple simulation of diffusion bridges with application to likelihood inference for diffusions. Working Paper, University of Copenhagen.
261
264
262
-
2. Guidoum AC, Boukhetala K (2020). Sim.DiffProc: Simulation of Diffusion Processes. R package version 4.7, URL https://cran.r-project.org/package=Sim.DiffProc.
265
+
2. Guidoum AC, Boukhetala K (2020). Sim.DiffProc: Simulation of Diffusion Processes. R package version 4.8, URL https://cran.r-project.org/package=Sim.DiffProc.
## ----02,fig.env='figure*', fig.cap='The path mean of the solution of the CKLS model with the estimated parameters and real data ',fig.width=6,fig.height=4----
Copy file name to clipboardExpand all lines: inst/doc/fitsde.Rmd
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,7 @@ As an example, we consider the Chan-Karolyi-Longstaff-Sanders (CKLS) model:
70
70
with $\theta_{1}=1$, $\theta_{2}=2$, $\theta_{3}=0.5$ and $\theta_{4}=0.3$. Before calling `fitsde`, we generate sampled data $X_{t_{i}}$, with $\Delta t =10^{-4}$, as following:
71
71
72
72
```{r}
73
+
set.seed(12345, kind = "L'Ecuyer-CMRG")
73
74
f <- expression( (1+2*x) ) ; g <- expression( 0.5*x^0.3 )
with $\theta_{1}=3$, $\theta_{2}=2$ and $\theta_{3}=0.5$, we generate sampled data $X_{t_{i}}$, with $\Delta t =10^{-2}$, as following:
130
131
131
132
```{r}
133
+
set.seed(1234, kind = "L'Ecuyer-CMRG")
132
134
f <- expression( 3*(2-x) ) ; g <- expression( 0.5 )
133
135
sim <- snssde1d(drift=f,diffusion=g,x0=5,Dt=0.01)
134
136
HWV <- sim$X
@@ -175,6 +177,7 @@ As an example, we consider the following model:
175
177
with: $a(t) = \theta_{1}t$, and we generate sampled data $X_{t_{i}}$, with $\theta_{1}=-2$, $\theta_{2}=0.2$ and time step $\Delta t =10^{-3}$, as following:
@@ -208,6 +211,7 @@ We consider the following Hull-White (extended Vasicek) model:
208
211
with: $a(t) = \theta_{1}t$ and $b(t)=\theta_{2}\sqrt{t}$, the volatility depends on time: $\sigma(t)=\theta_{3}t$. We generate sampled data of $X_t$, with $\theta_{1}=3$, $\theta_{2}=1$ and $\theta_{3}=0.3$, time step $\Delta t =10^{-3}$, as following:
209
212
210
213
```{r}
214
+
set.seed(1234, kind = "L'Ecuyer-CMRG")
211
215
f <- expression(3*t*(sqrt(t)-x)) ; g <- expression(0.3*t)
In Figure 2 we reports the sample mean of the solution of the CKLS model with the estimated parameters and real data, their empirical $95\%$ confidence bands (from the $2.5th$ to the $97.5th$ percentile), we can proceed as follows:
318
323
319
324
```{r 02,fig.env='figure*', fig.cap='The path mean of the solution of the CKLS model with the estimated parameters and real data ',fig.width=6,fig.height=4}
325
+
set.seed(1234, kind = "L'Ecuyer-CMRG")
320
326
f <- expression( (2.076-0.263*x) )
321
327
g <- expression( 0.130*x^1.451 )
322
328
mod <- snssde1d(drift=f,diffusion=g,x0=X[1],M=500, N=length(X),t0=1964.471, T=1989.333)
1. Brouste A, Fukasawa M, Hino H, Iacus SM, Kamatani K, Koike Y, Masuda H, Nomura R,Ogihara T, Shimuzu Y, Uchida M, Yoshida N (2014). The YUIMA Project: A ComputationalFramework for Simulation and Inference of Stochastic Differential Equations." Journal of Statistical Software, 57(4), 1-51. URL http://www.jstatsoft.org/v57/i04.
353
+
1. Brouste A, Fukasawa M, Hino H, Iacus SM, Kamatani K, Koike Y, Masuda H, Nomura R,Ogihara T, Shimuzu Y, Uchida M, Yoshida N (2014). The YUIMA Project: A ComputationalFramework for Simulation and Inference of Stochastic Differential Equations." Journal of Statistical Software, 57(4), 1-51. URL https://www.jstatsoft.org/v57/i04.
348
354
349
-
2. Guidoum AC, Boukhetala K (2020). Sim.DiffProc: Simulation of Diffusion Processes. R package version 4.7, URL https://cran.r-project.org/package=Sim.DiffProc.
355
+
2. Guidoum AC, Boukhetala K (2020). "Performing Parallel Monte Carlo and
356
+
Moment Equations Methods for Itô and Stratonovich Stochastic
357
+
Differential Systems: R Package Sim.DiffProc". Journal of Statistical Software, 96(2), 1--82. https://doi.org/10.18637/jss.v096.i02
350
358
351
359
3. Iacus SM (2008). Simulation and Inference for Stochastic Differential Equations: With R Examples. Springer-Verlag, New York.
0 commit comments