Description Usage Arguments Value References Examples
This function performs one step propagation using the sequential importantce sampling with full information proposal distribuiton under clutter environment.
1 | Sstep.Clutter.Full(mm, xx, logww, yyy, par, xdim, ydim, resample.sch)
|
mm |
the Monte Carlo sample size |
xx |
the samples in the last iteration. |
logww |
the log weight in the last iteration. |
yyy |
the observations. |
par |
a list of parameter values |
xdim |
the dimension of the state varible |
ydim |
the dimension of the observation |
resample.sch |
a binary vector of length |
The function returns a list with the following components:
xx |
the new sample. |
logww |
the log weights. |
r.index |
resample index, if |
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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | nk <- 5
nobs <- 100; pd <- 0.95; ssw <- 0.1; ssv <- 0.1;
xx0 <- 0; ss0 <- 0.1; nyy <- 50; yrange <- c(-80,80);
xdim <- 2; ydim <- nyy; yr <- yrange[2]-yrange[1]
par <- list(ssw=ssw,ssv=ssv,nyy=nyy,pd=pd,yr=yr)
#--- simulation for repeated use
Yy <- array(dim=c(nyy,nobs,nk))
Xx <- matrix(ncol=nk,nrow=nobs)
Ii <- matrix(ncol=nk,nrow=nobs)
kk <- 0
seed.k <- 1
while(kk < nk){
seed.k <- seed.k+1
set.seed(seed.k)
kk <- kk+1
simu <- simuTargetClutter(nobs,pd,ssw,ssv,xx0,ss0,nyy,yrange)
if(max(abs(simu$yy))>80){
kk <- kk-1
}else{
Xx[,kk] <- simu$xx; Yy[,,kk] <- simu$yy; Ii[,kk] <- simu$ii
}
}
resample.sch <- rep.int(1,nobs)
delay <- 0; mm <- 10000;
Xxhat.full <- array(dim=c(nobs,1,nk))
Xxhat.p <- array(dim=c(nobs,1,nk))
Xres.com2 <- array(dim=c(nobs,2,nk))
set.seed(1)
for(kk in 1:nk){
xx.init <- matrix(nrow=2,ncol=mm)
xx.init[1,] <- yrange[1]+runif(mm)*yr
xx.init[2,] <- rep(0.1,mm)
out1 <- SMC(Sstep.Clutter,nobs,Yy[,,kk],mm,par,
xx.init,xdim,ydim,resample.sch)
Xxhat.p[,1,kk] <- out1$xhat[1,,1]
out2 <- SMC.Full(Sstep.Clutter.Full,nobs,Yy[,,kk],mm,par,
xx.init,xdim,ydim,resample.sch)
Xxhat.full[,1,kk] <- out2$xhat[1,,1]
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.