Description Usage Arguments Value References Examples
Generic sequential Monte Carlo smoothing with marginal weights.
1 2 | SMC.Smooth(SISstep, SISstep.Smooth, nobs, yy, mm, par, xx.init, xdim, ydim,
resample.sch, funH = identity)
|
SISstep |
a function that performs one propagation step using a proposal distribution.
Its input includes |
SISstep.Smooth |
the function for backward smoothing step. |
nobs |
the number of observations |
yy |
the observations with |
mm |
the Monte Carlo sample size |
par |
a list of parameter values. |
xx.init |
the initial samples of |
xdim |
the dimension of the state varible |
ydim |
the dimension of the observation |
resample.sch |
a binary vector of length |
funH |
a user supplied function |
The function returns the smoothed values.
Tsay, R. and Chen, R. (2019). Nonlinear Time Series Analysis. Wiley, New Jersey.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | s2 <- 20 #second sonar location at (s2,0)
q <- c(0.03,0.03)
r <- c(0.02,0.02)
nobs <- 200
start <- c(10,10,0.01,0.01)
H <- c(1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1)
H <- matrix(H,ncol=4,nrow=4,byrow=TRUE)
W <- c(0.5*q[1], 0,0, 0.5*q[2],q[1],0,0,q[2])
W <- matrix(W,ncol=2,nrow=4,byrow=TRUE)
V <- diag(r)
mu0 <- start
SS0 <- diag(c(1,1,1,1))*0.01
simu_out <- simPassiveSonar(nobs,q,r,start,seed=20)
resample.sch <- rep(1,nobs)
xdim <- 4;ydim <- 2;
mm <- 5000
par <- list(H=H,W=W,V=V,s2=s2)
xx.init <- mu0+SS0%*%matrix(rnorm(mm*4),nrow=4,ncol=mm)
yy=simu_out$yy
out.s5K <- SMC.Smooth(Sstep.Sonar,Sstep.Smooth.Sonar,nobs,yy,mm,par,
xx.init,xdim,ydim,resample.sch)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.