From 3008e61f111f27c9a442f62b82f8439290da5f48 Mon Sep 17 00:00:00 2001 From: Joe Feldman Date: Wed, 4 Jan 2023 16:08:47 -0500 Subject: [PATCH 1/2] Fixed a bug in posterior predictive simulation --- R/Software.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Software.R b/R/Software.R index 0b98e15..0d6e934 100644 --- a/R/Software.R +++ b/R/Software.R @@ -745,9 +745,9 @@ get_predictive_Y<-function(mcmc, cs<- sample(unique_z, n, replace = T, prob = pi_h[unique_z]) etas = NULL #need to fix this - etas = do.call(rbind, data.frame(t(sapply(unique(cs),function(x) return(rbind(etas, + etas = as.matrix(do.call(rbind, data.frame(t(sapply(unique(cs),function(x) return(rbind(etas, mvrnorm(sum(cs == x),mu[[x]], - Delta[[x]]))))))) + Delta[[x]])))))))) }else{ etas = mvrnorm(n,mu[[unique_z]], Delta[[unique_z]]) From 728bcf08aad36121d0b9420c375bc0914dea4307 Mon Sep 17 00:00:00 2001 From: Joe Feldman <50495595+jfeldman396@users.noreply.github.com> Date: Wed, 4 Jan 2023 17:54:52 -0500 Subject: [PATCH 2/2] Update Software.R --- R/Software.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Software.R b/R/Software.R index 0d6e934..0b98e15 100644 --- a/R/Software.R +++ b/R/Software.R @@ -745,9 +745,9 @@ get_predictive_Y<-function(mcmc, cs<- sample(unique_z, n, replace = T, prob = pi_h[unique_z]) etas = NULL #need to fix this - etas = as.matrix(do.call(rbind, data.frame(t(sapply(unique(cs),function(x) return(rbind(etas, + etas = do.call(rbind, data.frame(t(sapply(unique(cs),function(x) return(rbind(etas, mvrnorm(sum(cs == x),mu[[x]], - Delta[[x]])))))))) + Delta[[x]]))))))) }else{ etas = mvrnorm(n,mu[[unique_z]], Delta[[unique_z]])