Description Usage Arguments Value References Examples
This function implements one step of the sequential importance sampling method for fading channels.
1 | SISstep.fading(mm, xx, logww, yyy, par, xdim2, ydim)
|
mm |
the Monte Carlo sample size |
xx |
the sample in the last iteration. |
logww |
the log weight in the last iteration. |
yyy |
the observations with |
par |
a list of parameter values. |
xdim2 |
the dimension of the state varible |
ydim |
the dimension of the observation |
The function returns a list with the following components:
xx |
the new sample. |
logww |
the log weights. |
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 | HH <- matrix(c(2.37409, -1.92936, 0.53028,0,1,0,0,0,0,1,0,0,0,0,1,0),ncol=4,byrow=TRUE)
WW <- matrix(c(1,0,0,0),nrow=4)
GG <- matrix(0.01*c(0.89409,2.68227,2.68227,0.89409),nrow=1)
nobs <- 10050
tt <- 50:(nobs-1)
mm <- 100; resample.sch <- rep(1,nobs)
VV <- 1.3**15*0.001
par <- list(HH=HH,WW=WW,GG=GG,VV=VV)
simu <- simu_fading(nobs,par)
ydim <- 1
mm.all <- c(100,200,500,1000,4000,8000)
kk <- 6
xdim2 <- 6
BER.S <- 1:kk
for (i in 1:kk){
mm <- mm.all[i]
SS0 <- diag(c(1,1,1,1))
for(n0 in 1:20){
SS0 <- HH%*%SS0%*%t(HH)+WW%*%t(WW)
}
xx.init <- matrix(nrow=xdim2,ncol=mm)
xx.init[1:4,] <- sqrt(SS0)%*%matrix(rnorm(4*mm),nrow=4,ncol=mm)
xx.init[5,] <- sample.int(2,mm,0.5)
xx.init[6,] <- rep(1,mm)
print(c(i));flush.console()
out <- SMC(SISstep.fading,nobs,simu$yy,mm,par,xx.init,
xdim2,ydim,resample.sch)
Strue <- simu$ss[2:nobs]*simu$ss[1:(nobs-1)]
Shat <- rep(-1,(nobs-1))
Shat[out$xhat[6,2:nobs,1]>0.5] <- 1
BER.S[i] <- sum(abs(Strue[tt]-Shat[tt]))/(nobs-50)/2
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.