poisson.random.sampling | R Documentation |
Poisson random sampling method.
poisson.random.sampling(x, rate, n)
x |
an object of |
rate |
a Poisson intensity or a vector of Poisson intensities. |
n |
a common multiplier to the Poisson intensities. The default value is 1. |
It returns an object
of type yuima.data-class
which is a copy of the original input
data where observations are sampled according to
the Poisson process. The unsampled data are set to NA
.
an object of yuima.data-class
.
The YUIMA Project Team
cce
## Set a model diff.coef.1 <- function(t, x1=0, x2) x2*(1+t) diff.coef.2 <- function(t, x1, x2=0) x1*sqrt(1+t^2) cor.rho <- function(t, x1=0, x2=0) sqrt((1+cos(x1*x2))/2) diff.coef.matrix <- matrix(c("diff.coef.1(t,x1,x2)", "diff.coef.2(t,x1,x2)*cor.rho(t,x1,x2)", "", "diff.coef.2(t,x1,x2)*sqrt(1-cor.rho(t,x1,x2)^2)"),2,2) cor.mod <- setModel(drift=c("",""), diffusion=diff.coef.matrix, solve.variable=c("x1", "x2"), xinit=c(3,2)) set.seed(111) ## We first simulate the two dimensional diffusion model yuima.samp <- setSampling(Terminal=1, n=1200) yuima <- setYuima(model=cor.mod, sampling=yuima.samp) yuima.sim <- simulate(yuima) ## Then we use function poisson.random.sampling to get observations ## by Poisson sampling. psample <- poisson.random.sampling(yuima.sim, rate = c(0.2, 0.3), n=1000) str(psample)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.