From 097cf36294c4598828478beeb8b5d8c0939e3e42 Mon Sep 17 00:00:00 2001 From: amckay Date: Fri, 15 Jul 2016 17:43:15 -0400 Subject: [PATCH] bug fix in Markov chain simulation With num_reps > 1 the t+1 draw of the chain was always using the distribution conditional on the value at t for the first repetition. --- src/markov/mc_tools.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markov/mc_tools.jl b/src/markov/mc_tools.jl index 60b3b40b..8682691f 100644 --- a/src/markov/mc_tools.jl +++ b/src/markov/mc_tools.jl @@ -382,7 +382,7 @@ function simulate!(mc::MarkovChain, X::Matrix{Int}) for i in 1:k for t in 1:ts_length-1 - X[t+1, i] = draw(P_dist[X[t]]) + X[t+1, i] = draw(P_dist[X[t,i]]) end end X