if (FALSE) {
#### Using default Data1, no sigma estimation ####
Res <- PF_lm_ss(n = 10000L, sigma_est = FALSE) #10 times more than in PF_lm
lapply(Res,class) # Structure of returning list.
###Summary of estimated parameters
Res$summ
#Evolution of the estimated parameters
par(mfrow=c(2, 2))
for (i in 1:4){
plot(apply(Res$stateP_res[[i]],1,mean), main = colnames(Res$summ)[i], col="blue",
xlab = "", ylab = "",type="l")
}
#### Using default Data1, with sigma estimation ####
Res2 <- PF_lm_ss(n = 1000L, sigma_est = TRUE)
lapply(Res2,class) # Structure of returning list
###Summary of the estimated parameters
Res2$summ
#Evolution of the estimated parameters
par(mfrow=c(2, 3))
for (i in 1:5){
plot(apply(Res2$stateP_res[[i]],1,mean), main = colnames(Res2$summ)[i], col="blue",
xlab = "", ylab = "",type="l")
}
#### Using default Data1, given initDisPar ####
b0 <- matrix(c(1.9, 2, # Prior of a_0
1, 1.5, # Prior of a_1
2, 3, # Prior of a_2
-1, 0), # Prior of a_3
ncol = 2, byrow = TRUE )
Res3 <- PF_lm_ss(n = 10000L, sigma_est = FALSE, initDisPar = b0)
lapply(Res3,class) # Structure of returning list.
###Summary of the estimated parameters
Res3$summ
#Evolution of the estimated parameters
par(mfrow=c(2, 2))
for (i in 1:4){
plot(apply(Res3$stateP_res[[i]],1,mean), main = colnames(Res3$summ)[i], col="blue",
xlab = "", ylab = "",type="l")
}
}
Run the code above in your browser using DataLab