commit 700c0804390b6f4bdf10dfa563e5d9cef0ea7a7d
parent 59d68c41432b67cbc77227af947dd74de1e08bec
Author: Jared Tobin <jared@jtobin.ca>
Date: Wed, 16 Mar 2016 22:50:22 +1300
Misc adjustments.
Diffstat:
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/finite-gaussian-mixture/src/fmm_multivariate_conditional_collapsed.r b/finite-gaussian-mixture/src/fmm_multivariate_conditional_collapsed.r
@@ -70,7 +70,7 @@ conditional_label_model = function(y, k, z, a, l, r, b, w) {
new_label = sample(cluster_labels, size = 1, prob = probs)
z[i] <<- new_label
- new_stats = cluster_statistics(y[which(z == new_label),], l, b, w) # FIXME: ???
+ new_stats = cluster_statistics(y[which(z == new_label),], l, b, w)
sufficient_statistics[[new_label]] <<- new_stats
new_label
@@ -84,7 +84,6 @@ inverse_model = function(n, k, y, a, l, r, b, w) {
}
params = list(z = sample(seq(k), size = nrow(y), replace = T))
acc = params
- # FIXME (jtobin): can use replicate
for (j in seq(n - 1)) {
params = gibbs(params$z)
acc$z = rbind(acc$z, params$z)
@@ -92,5 +91,3 @@ inverse_model = function(n, k, y, a, l, r, b, w) {
acc
}
-
-# FIXME something fucked up somewhere
diff --git a/finite-gaussian-mixture/src/sim_fmm_2d_conditional_collapsed.r b/finite-gaussian-mixture/src/sim_fmm_2d_conditional_collapsed.r
@@ -14,7 +14,7 @@ config = list(
, r = diag(0.05, dimension)
, b = 2
, w = diag(1, dimension)
- , n = 100
+ , n = 50
)
set.seed(222)
@@ -36,7 +36,7 @@ params = inverse_model(
)
early = data.frame(x = m$x, y = m$y, variable = params$z[1,])
-mid = data.frame(x = m$x, y = m$y, variable = params$z[round(config$n * 3 / 4),])
+mid = data.frame(x = m$x, y = m$y, variable = params$z[round(config$n * 1 / 2),])
late = data.frame(x = m$x, y = m$y, variable = params$z[config$n - 1,])
p_early =