SMC.Smooth: Generic Sequential Monte Carlo Smoothing with Marginal...

Description Usage Arguments Value References Examples

Description

Generic sequential Monte Carlo smoothing with marginal weights.

Usage

1
2
SMC.Smooth(SISstep, SISstep.Smooth, nobs, yy, mm, par, xx.init, xdim, ydim,
  resample.sch, funH = identity)

Arguments

SISstep

a function that performs one propagation step using a proposal distribution. Its input includes (mm,xx,logww,yyy,par,xdim,ydim), where xx and logww are the last iteration samples and log weight. yyy is the observation at current time step. It should return xx (the samples xt) and logww (their corresponding log weight).

SISstep.Smooth

the function for backward smoothing step.

nobs

the number of observations T.

yy

the observations with T columns and ydim rows.

mm

the Monte Carlo sample size m.

par

a list of parameter values.

xx.init

the initial samples of x_0.

xdim

the dimension of the state varible x_t.

ydim

the dimension of the observation y_t.

resample.sch

a binary vector of length nobs, reflecting the resampling schedule. resample.sch[i]= 1 indicating resample should be carried out at step i.

funH

a user supplied function h() for estimation E(h(x_t) | y_t+d). Default is identity for estimating the mean. The function should be able to take vector or matrix as input and operates on each element of the input.

Value

The function returns the smoothed values.

References

Tsay, R. and Chen, R. (2019). Nonlinear Time Series Analysis. Wiley, New Jersey.

Examples

 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)

ConvFuncTimeSeries/test_t documentation built on May 29, 2019, 1:39 p.m.