# NOT RUN {
# Simulate 100 observations from 3 balanced groups with cluster-specific numbers of latent factors
# Specify isotropic uniquenesses within each cluster
sim_data <- sim_IMIFA_data(N=100, G=3, P=20, Q=c(2, 2, 5), psi=1:3)
names(attributes(sim_data))
labels <- attr(sim_data, "Labels")
# Visualise the data in two-dimensions
plot(cmdscale(dist(sim_data), k=2), col=labels)
# Fit a MIFA model to this data
# tmp <- mcmc_IMIFA(sim_data, method="MIFA", range.G=3, n.iters=5000)
# }
Run the code above in your browser using DataLab