rsde3d: Approximate transitional densities and random generation for...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rsde.R

Description

Transition density and random generation for the joint and marginal of (X(t-s),Y(t-s),Z(t-s) | X(s)=x0,Y(s)=y0,Z(s)=z0) of the SDE's 3-d.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rsde3d(object, ...)
dsde3d(object, ...)

## Default S3 method:
rsde3d(object, at, ...)

## Default S3 method:
dsde3d(object, pdf=c("Joint","Marginal"), at, ...)
## S3 method for class 'dsde3d'
plot(x,display="rgl",hist=FALSE,...)

Arguments

object

an object inheriting from class snssde3d and bridgesde3d.

at

time between s=t0 and t=T. The default at = T.

pdf

probability density function Joint or Marginal.

x

an object inheriting from class dsde3d.

display

display plots.

hist

if hist=TRUE plot histogram. Based on truehist function.

...

potentially arguments to be passed to methods, such as density for marginal density and sm.density for joint density.

Details

The function rsde3d returns a M random variable x(t=at),y(t=at),z(t=at) realize at time t=at.

fig05

And dsde3d returns a trivariate kernel density approximation for (X(t-s),Y(t-s),Z(t-s) | X(s)=x0,Y(s)=y0,Z(s)=z0). with t=at is a fixed time between t0 and T.

fig06

An overview of this package, see browseVignettes('Sim.DiffProc') for more informations.

Value

dsde3d gives the trivariate density approximation (X(t-s),Y(t-s),Z(t-s) | X(s)=x0,Y(s)=y0,Z(s)=z0). rsde3d generates random of the (X(t-s),Y(t-s),Z(t-s) | X(s)=x0,Y(s)=y0,Z(s)=z0).

Author(s)

A.C. Guidoum, K. Boukhetala.

See Also

kde Kernel density estimate for 1- to 6-dimensional data in "ks" package.

sm.density Nonparametric density estimation in one, two or three dimensions in "sm" package.

kde3d Compute a three dimension kernel density estimate in "misc3d" package.

rng random number generators in "yuima" package.

rcBS, rcCIR, rcOU and rsOU in package "sde".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
## Example 1: Ito sde
## dX(t) = (2*(Y(t)>0)-2*(Z(t)<=0)) dt + 0.2 * dW1(t) 
## dY(t) = -2*Y(t) dt + 0.2 * dW2(t) 
## dZ(t) = -2*Z(t) dt + 0.2 * dW3(t)        
## W1(t), W2(t) and W3(t) three independent Brownian motion
set.seed(1234)
fx <- expression(2*(y>0)-2*(z<=0) , -2*y, -2*z)
gx <- rep(expression(0.2),3)
mod3d1 <- snssde3d(x0=c(0,2,-2),drift=fx,diffusion=gx,M=1000,Dt=0.003)

# random at t= 0.75
r3d1 <- rsde3d(mod3d1,at=0.75)
summary(r3d1)

# Marginal transition density at t=0.75, t0=0

denM <- dsde3d(mod3d1,pdf="M",at=0.75)
denM
plot(denM)

# for Joint transition density at t=0.75;t0=0 
# Multiple isosurfaces
## Not run: 
denJ <- dsde3d(mod3d1,pdf="J", at= 0.75)
denJ
plot(denJ,display="rgl")

## End(Not run)

## Example 2: Stratonovich sde
## dX(t) = Y(t)* dt + X(t) o dW1(t)          
## dY(t) = (4*( 1-X(t)^2 )* Y(t) - X(t))* dt + 0.2 o dW2(t)
## dZ(t) = (4*( 1-X(t)^2 )* Z(t) - X(t))* dt + 0.2 o dW3(t)
set.seed(1234)

fx <- expression( y , (4*( 1-x^2 )* y - x), (4*( 1-x^2 )* z - x))
gx <- expression( x , 0.2, 0.2)
mod3d2 <- snssde3d(drift=fx,diffusion=gx,M=1000,type="str")

# random 
r3d2 <- rsde3d(mod3d2)
summary(r3d2)

# Marginal transition density at t=1, t0=0

denM <- dsde3d(mod3d2,pdf="M")
denM
plot(denM)

# for Joint transition density at t=1;t0=0
# Multiple isosurfaces
## Not run: 
denJ <- dsde3d(mod3d2,pdf="J")
denJ
plot(denJ,display="rgl")

## End(Not run)

## Example 3: Tivariate Transition Density of 3 Brownian motion (W1(t),W2(t),W3(t)) in [0,1]

## Not run: 
B3d <- snssde3d(drift=rep(expression(0),3),diffusion=rep(expression(1),3),M=500)
for (i in seq(B3d$Dt,B3d$T,by=B3d$Dt)){
plot(dsde3d(B3d, at = i,pdf="J"),box=F,main=paste0('Transition Density t = ',i))
}

## End(Not run)

Sim.DiffProc documentation built on Nov. 8, 2020, 4:27 p.m.