andland / logisticPCA

Dimensionality reduction for binary data
Other
49 stars 9 forks source link

log_like_Bernoulli incorrect when missing data? #8

Closed andland closed 9 years ago

andland commented 9 years ago

n = 100 d = 10 x = matrix(sample(c(0, 1), d * n, TRUE), nrow = n) log_like_Bernoulli(x = x, theta = outer(rep(1,n), gtools::logit(colMeans(x, na.rm = TRUE))))

which_missing = matrix(runif(n * d) < 0.25, nrow = d) is.na(x[which_missing]) <- TRUE log_like_Bernoulli(x = x, theta = outer(rep(1,n), gtools::logit(colMeans(x, na.rm = TRUE))))

loglike goes up with less data?