Mixture Models in R
Victor Medina
Researcher at The University of Edinburgh
digits_sample <- as.matrix(digits)
dim(digits_sample)
320 256
show_digit(digits_sample[320,])
bernoulli_mix_model <- flexmix(digits_sample~1,
k=2,
model=FLXMCmvbinary(),
control = list(tolerance = 1e-15, iter.max = 1000))
digits_sample
is a matrixFLXMCmvbinary()
specifies the Bernoulli distributionprior(bernoulli_mix_model)
0.503125 0.496875
param_comp1 <- parameters(bernoulli_mix_model, component = 1)
param_comp2 <- parameters(bernoulli_mix_model, component = 2)
dim(param_comp1)
256 1
head(param_comp1, 4)
Comp.1
center.V1 0.3291926
center.V2 0.5093168
center.V3 0.6645963
center.V4 0.7639751
show_digit(param_comp1)
show_digit(param_comp2)
Mixture Models in R