Skip to content

Commit b7e0060

Browse files
committed
version 4.2
2 parents 2d3409d + a2448a4 commit b7e0060

22 files changed

+814
-854
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Sim.DiffProc
22
Type: Package
33
Version: 4.2
4-
Date: 2018-10-17
4+
Date: 2018-10-18
55
Title: Simulation of Diffusion Processes
66
Authors@R: c(
77
person("Arsalane Chouaib", "Guidoum",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![minimal R version](https://img.shields.io/badge/R%3E%3D-2.15.1-blue.svg?style=flat-plastic)](https://cran.r-project.org/)
1212

1313
------------------------------------------------------------------------
14-
![Github](https://img.shields.io/badge/Github-4.2(at:2018.10.17)-blue.svg)
14+
![Github](https://img.shields.io/badge/Github-4.2(at:2018.10.18)-blue.svg)
1515
![](http://www.r-pkg.org/badges/version-last-release/Sim.DiffProc?color=blue) [![Rdoc](http://www.rdocumentation.org/badges/version/Sim.DiffProc)](http://www.rdocumentation.org/packages/Sim.DiffProc)
1616

1717

inst/NEWS.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
\section{CHANGES IN \pkg{Sim.DiffProc} VERSION 4.2}{
66
\itemize{
7-
\item{Release date: 2018-10-17.}
7+
\item{Release date: 2018-10-18.}
88
\item{Manual update.}
99
\item{Minor bug fixes: R (>= 3.5.0).}
1010
}

inst/doc/bridgesde.Rmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ Assume that we want to describe the following bridge sde in It
7474
\begin{equation}\label{eq0166}
7575
dX_t = \frac{1-X_t}{1-t} dt + X_t dW_{t},\quad X_{t_{0}}=3 \quad\text{and}\quad X_{T}=1
7676
\end{equation}
77-
We simulate a flow of $5000$ 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$.
77+
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$.
7878

7979
```{r}
8080
f <- expression((1-x)/(1-t))
8181
g <- expression(x)
82-
mod <- bridgesde1d(drift=f,diffusion=g,x0=3,y=1,M=5000,method="milstein")
82+
mod <- bridgesde1d(drift=f,diffusion=g,x0=3,y=1,M=1000,method="milstein")
8383
mod
8484
summary(mod) ## default: summary at time = (T-t0)/2
8585
```
@@ -179,12 +179,12 @@ dY_t = -(1+X_{t}) Y_{t} dt + 0.1 (1-X_{t}) \circ dW_{2,t},\quad Y_{t_{0}}=-0.5
179179
\end{cases}
180180
\end{equation}
181181

182-
We simulate a flow of $5000$ trajectories, with integration step size $\Delta t = 0.01$, and using Runge-Kutta method order 1:
182+
We simulate a flow of $1000$ trajectories, with integration step size $\Delta t = 0.01$, and using Runge-Kutta method order 1:
183183

184184
```{r}
185185
fx <- expression(-(1+y)*x , -(1+x)*y)
186186
gx <- expression(0.2*(1-y),0.1*(1-x))
187-
mod2 <- bridgesde2d(drift=fx,diffusion=gx,x0=c(1,-0.5),y=c(1,0.5),Dt=0.01,M=5000,type="str",method="rk1")
187+
mod2 <- bridgesde2d(drift=fx,diffusion=gx,x0=c(1,-0.5),y=c(1,0.5),Dt=0.01,M=1000,type="str",method="rk1")
188188
mod2
189189
summary(mod2) ## default: summary at time = (T-t0)/2
190190
```
@@ -297,12 +297,12 @@ dZ_t = 4 (1-Z_{t}) Y_{t} dt + 0.2 dW_{3,t},\quad Z_{t_{0}}=0.5 \quad\text{and}\q
297297
\end{cases}
298298
\end{equation}
299299

300-
We simulate a flow of $5000$ trajectories, with integration step size $\Delta t = 0.001$.
300+
We simulate a flow of $1000$ trajectories, with integration step size $\Delta t = 0.001$.
301301

302302
```{r}
303303
fx <- expression(-4*(1+x)*y, 4*(1-y)*x, 4*(1-z)*y)
304304
gx <- rep(expression(0.2),3)
305-
mod3 <- bridgesde3d(x0=c(0,-1,0.5),y=c(0,-2,0.5),drift=fx,diffusion=gx,M=5000)
305+
mod3 <- bridgesde3d(x0=c(0,-1,0.5),y=c(0,-2,0.5),drift=fx,diffusion=gx,M=1000)
306306
mod3
307307
summary(mod3) ## default: summary at time = (T-t0)/2
308308
```

inst/doc/bridgesde.html

Lines changed: 248 additions & 248 deletions
Large diffs are not rendered by default.

inst/doc/fitsde.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Parametric Estimation of 1-D Stochastic Differential Equation"
2+
title: "Parametric Estimation of 1-D Stochastic Differential Equation"
33
author:
44
- A.C. Guidoum^[Department of Probabilities & Statistics, Faculty of Mathematics, University of Science and Technology Houari Boumediene, BP 32 El-Alia, U.S.T.H.B, Algeria, E-mail ([email protected])] and K. Boukhetala^[Faculty of Mathematics, University of Science and Technology Houari Boumediene, BP 32 El-Alia, U.S.T.H.B, Algeria, E-mail ([email protected])]
55
date: "`r Sys.Date()`"

inst/doc/fitsde.html

Lines changed: 37 additions & 37 deletions
Large diffs are not rendered by default.

inst/doc/fptsde.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Set the model $X_t$:
9191
```{r}
9292
f <- expression( (1-0.5*x) )
9393
g <- expression( 1 )
94-
mod1d <- snssde1d(drift=f,diffusion=g,x0=1.7,M=10000,method="taylor")
94+
mod1d <- snssde1d(drift=f,diffusion=g,x0=1.7,M=1000,method="taylor")
9595
```
9696
Generate the first-passage-time $\tau_{S(t)}$, with `fptsde1d()` function ( based on `density()` function in [base] package):
9797
```{r}
@@ -166,7 +166,7 @@ Using `fptsde1d()` and `dfptsde1d()` functions in the [Sim.DiffProc](https://cra
166166
## Set the model X(t)
167167
f <- expression( 0.48*x )
168168
g <- expression( 0.07*x )
169-
mod1 <- snssde1d(drift=f,diffusion=g,x0=1,T=10,M=10000)
169+
mod1 <- snssde1d(drift=f,diffusion=g,x0=1,T=10,M=1000)
170170
## Set the boundary S(t)
171171
St <- expression( 7 + 3.2 * t + 1.4 * t * sin(1.75 * t) )
172172
## Generate the fpt
@@ -212,7 +212,7 @@ Using `fptsde1d()` and `dfptsde1d()` functions in the [Sim.DiffProc](https://cra
212212
theta1=0.5
213213
f <- expression( theta1*x*(10+0.2*sin(2*pi*t)+0.3*sqrt(t)*(1+cos(3*pi*t))-x) )
214214
g <- expression( sqrt(0.1)*x )
215-
mod2 <- snssde1d(drift=f,diffusion=g,x0=8,t0=1,T=4,M=10000)
215+
mod2 <- snssde1d(drift=f,diffusion=g,x0=8,t0=1,T=4,M=1000)
216216
## Set the boundary S(t)
217217
St <- expression( 12 )
218218
## Generate the fpt
@@ -279,7 +279,7 @@ Set the system $(X_t , Y_t)$:
279279
```{r}
280280
fx <- expression(5*(-1-y)*x , 5*(-1-x)*y)
281281
gx <- expression(0.5*y,0.5*x)
282-
mod2d <- snssde2d(drift=fx,diffusion=gx,x0=c(x=1,y=-1),M=10000,type="str")
282+
mod2d <- snssde2d(drift=fx,diffusion=gx,x0=c(x=1,y=-1),M=1000,type="str")
283283
```
284284
Generate the couple \((\tau_{(S(t),X_{t})},\tau_{(S(t),Y_{t})})\), with `fptsde2d()` function::
285285
```{r}
@@ -396,7 +396,7 @@ Set the system $(X_t , Y_t , Z_t)$:
396396
```{r}
397397
fx <- expression(4*(-1-x)*y , 4*(1-y)*x , 4*(1-z)*y)
398398
gx <- rep(expression(0.2),3)
399-
mod3d <- snssde3d(drift=fx,diffusion=gx,x0=c(x=2,y=-2,z=0),M=10000)
399+
mod3d <- snssde3d(drift=fx,diffusion=gx,x0=c(x=2,y=-2,z=0),M=1000)
400400
```
401401
Generate the triplet $(\tau_{(S(t),X_{t})},\tau_{(S(t),Y_{t})},\tau_{(S(t),Z_{t})})$, with `fptsde3d()` function::
402402
```{r}

inst/doc/fptsde.html

Lines changed: 174 additions & 174 deletions
Large diffs are not rendered by default.

inst/doc/mcmsde.Rmd

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,13 @@ sde.fun1d <- function(data, i){
6969
return(c(mean(d),var(d)))
7070
}
7171
# Parallel MOnte Carlo for mod1
72-
mcm.mod1 = MCM.sde(model=mod1,statistic=sde.fun1d,R=100, exact=list(m=E.mod1(1),S=V.mod1(1)),parallel="snow",ncpus=2)
72+
mcm.mod1 = MCM.sde(model=mod1,statistic=sde.fun1d,R=10, exact=list(m=E.mod1(1),S=V.mod1(1)),parallel="snow",ncpus=2)
7373
mcm.mod1
7474
# Parallel MOnte Carlo for mod2
75-
mcm.mod2 = MCM.sde(model=mod2,statistic=sde.fun1d,R=100, exact=list(m=E.mod2(1),S=V.mod2(1)),parallel="snow",ncpus=2)
75+
mcm.mod2 = MCM.sde(model=mod2,statistic=sde.fun1d,R=10, exact=list(m=E.mod2(1),S=V.mod2(1)),parallel="snow",ncpus=2)
7676
mcm.mod2
7777
```
7878

79-
```{r,fig.cap=' MC output of mean and variance of `mod1`', fig.env='figure*'}
80-
# plot(s) of Monte Carlo outputs of mod1
81-
plot(mcm.mod1,index = 1) # mean
82-
plot(mcm.mod1,index = 2) # variance
83-
```
84-
85-
```{r,fig.cap=' MC output of mean and variance of `mod2`', fig.env='figure*'}
86-
# plot(s) of Monte Carlo outputs of mod2
87-
plot(mcm.mod2,index = 1) # mean
88-
plot(mcm.mod2,index = 2) # variance
89-
```
9079

9180
## Two-dimensional SDEs
9281

@@ -109,7 +98,7 @@ sde.fun2d <- function(data, i){
10998
return(c(mean(d$x),mean(d$y),var(d$x),var(d$y),cov(d$x,d$y)))
11099
}
111100
## Parallel Monte-Carlo of 'OUI' at time 10
112-
mcm.mod2d = MCM.sde(OUI,statistic=sde.fun2d,time=10,R=100,exact=tvalue,parallel="snow",ncpus=2)
101+
mcm.mod2d = MCM.sde(OUI,statistic=sde.fun2d,time=10,R=10,exact=tvalue,parallel="snow",ncpus=2)
113102
mcm.mod2d
114103
```
115104

@@ -126,7 +115,7 @@ sde.fun3d <- function(data, i){
126115
return(c(mean(d$x),median(d$x),Mode(d$x),var(d$x),cov(d$x,d$y),cov(d$x,d$z)))
127116
}
128117
## Monte-Carlo at time = 10
129-
mcm.mod3d = MCM.sde(modtra,statistic=sde.fun3d,R=100,parallel="snow",ncpus=2)
118+
mcm.mod3d = MCM.sde(modtra,statistic=sde.fun3d,R=10,parallel="snow",ncpus=2)
130119
mcm.mod3d
131120
```
132121

0 commit comments

Comments
 (0)