knitr::opts_chunk$set(echo = TRUE)

R build status

clusterCVR provides an EM Algorithm for Mixture Models of Votes with Varying Choice Sets. It is a clustering algorithm particularly designed for analyzing mid to high dimensional datasets when voters vote on Republican or Democratic candidates on the long ballot.

Loading

library(clusterCVR)

Derivation

See cat-mixture.pdf for the writeup of the model. Source is cat-mixture.tex

Usage

No varying choice set

data("simdata_full")
out_cl <- clusterCVR(simdata_full, init = "kmeans")

summary(out_cl)

We can also check the log likelihood monotonically increasing:

pars <- summ_params(out_cl)
graph_trend(pars, simdata_full)
library(Rmixmod)
data(birds)
head(birds) # data where all variables are factor

out_mm <- mixmodCluster(data = birds, nbCluster = 3)
summary(out_mm)


kuriwaki/clusterCVR documentation built on July 31, 2024, 8:28 p.m.