Sstep.Sonar: Sequential Importance Sampling Step for A Target with Passive...

Description Usage Arguments Value References Examples

Description

This function implements one step of the sequential importance sampling method for a target with passive sonar.

Usage

1
Sstep.Sonar(mm, xx, logww, yy, par, xdim = 1, ydim = 1)

Arguments

mm

the Monte Carlo sample size m.

xx

the sample in the last iteration.

logww

the log weight in the last iteration.

yy

the observations with T columns and ydim rows.

par

a list of parameter values. H is the state coefficient matrix, W*t(W) is the state innovation covariance matrix, V*t(V) is the covariance matrix of the observation noise, s2 is the second sonar location.

xdim

the dimension of the state varible x_t.

ydim

the dimension of the observation y_t.

Value

The function returns a list with the following components:

xx

the new sample.

logww

the log weights.

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
22
23
24
25
26
27
28
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)
yy <- simu_out$yy
mm <- 100000
resample.sch <- rep(1,nobs)
par <- list(H=H,W=W,V=V,s2=s2)
xdim <- 4;ydim <- 2;
xx.init <- mu0+SS0%*%matrix(rnorm(mm*4),nrow=4,ncol=mm)
delay <- 20
out <- SMC(Sstep.Sonar,nobs,yy,mm,par,xx.init,xdim,ydim,resample.sch,delay)
tt <- 100:200
plot(simu_out$xx[1,tt],simu_out$xx[2,tt],xlab='x',ylab='y',xlim=c(25.8,34))
for(dd in c(1,11,21)){
	tt <- 100:(200-dd)
	lines(out$xhat[1,tt,dd],out$xhat[2,tt,dd],lty=22-dd,lwd=2)
}
legend(26.1,-12,legend=c("delay 0","delay 10","delay 20"),lty=c(21,11,1))

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