commit c9235d1a0656de0d9969ee3f87f5feefe397e9e1
parent d8f134cc44b1cf1b6fde34d8427af7f43a3b06bd
Author: Jared Tobin <jared@jtobin.ca>
Date: Sat, 12 Mar 2016 22:10:51 +1300
Plot tweaks.
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/finite-gaussian-mixture/src/simulation_conditional.r b/finite-gaussian-mixture/src/simulation_conditional.r
@@ -13,7 +13,7 @@ config = list(
, r = 0.01
, b = 1
, w = 1
- , n = 1000
+ , n = 500
)
origin = list(
@@ -22,7 +22,10 @@ origin = list(
, s = precision_model(config$k, config$b, config$w)
)
-d = melt(model(config$k, config$n))
+# d = melt(model(config$k, config$n))
+# check with different-probability clusters as well
+d = data.frame(
+ value = c(rnorm(250, -3, 0.25), rnorm(500, 0, 0.25), rnorm(250, 3, 0.25)))
set.seed(990909)
@@ -39,9 +42,6 @@ dl = melt(as.data.frame(params$l))
py = ggplot(d, aes(value)) + geom_histogram(alpha = 0.5, fill = 'darkblue')
-py_true = ggplot(d, aes(value, colour = factor(L1), fill = factor(L1))) +
- geom_histogram(alpha = 0.5)
-
pp = ggplot(dp, aes(x = seq_along(value), y = value, colour = variable)) +
geom_line()
@@ -70,8 +70,6 @@ p_late =
ggplot(late, aes(value, colour = factor(variable), fill = factor(variable))) +
geom_histogram(alpha = 0.5)
-true_plots = grid.arrange(py, py_true, nrow = 2)
-
chain_plots = grid.arrange(py, pp, pm, ps, nrow = 2, ncol = 2)
inferred_plots = grid.arrange(py, p_early, p_mid, p_late, nrow = 2, ncol = 2)