search for: p_s0_t_1

Displaying 1 result from an estimated 1 matches for "p_s0_t_1".

Did you mean: p_s0_t
2011 Dec 01
1
Estimation of AR(1) Model with Markov Switching
...1 <- pnorm(gamma_s1) p_s1_s0 <- 1-pnorm(gamma_s0) p_s1_s1 <- 1-pnorm(gamma_s1) # create data matrix X <- cbind(1,y) # assume erogodicity of the markov chain # use unconditional probabilities p0_s0 <- (1 - p_s1_s1) / (2 -p_s0_s0 -p_s1_s1) p0_s1 <- 1-p0_s0 # create variables p_s0_t_1 <- rep(0, nrow(X)) p_s1_t_1 <- rep(0, nrow(X)) p_s0_t <- rep(0, nrow(X)) p_s1_t <- rep(0, nrow(X)) f_s0 <- rep(0,nrow(X)-1) f_s1 <- rep(0,nrow(X)-1) f <- rep(0,nrow(X)-1) logf <- rep(0, nrow(X)-1) p_s0_t[1] <- p0_s0 p_s1_t[1] <- p0_s1 # initiate hamilton filter for...