# NOT RUN {
set.seed(1)
x <- cumsum(rnorm(100))
y <- rnorm(100, x)
model <- ssm_ulg(y, Z = 1, T = 1, R = 1, H = 1, P1 = 1)
system.time(out <- particle_smoother(model, particles = 1000))
# same with simulation smoother:
system.time(out2 <- sim_smoother(model, particles = 1000,
use_antithetic = TRUE))
ts.plot(out$alphahat, rowMeans(out2), col = 1:2)
# }
Run the code above in your browser using DataLab