gom_bayes: Bayesian Grade of Membership Mixture Model

View source: R/gom_bayes.R

gom_bayesR Documentation

Bayesian Grade of Membership Mixture Model

Description

This function takes a data object and creates a joint posterior distribution of pure type probabilities, which characterize a small set of extreme profiles, along with the posterior distribution of the grade of membership estimates and the posterior distribution of the Dirichlet distribution hyperparameters.

Usage

gom_bayes(
  data,
  ntypes = 2,
  alpha = "",
  burnin = 250,
  ngibbs = 250,
  omega = 50,
  eta = 10,
  tau = 2,
  beta = 2,
  gomscores = "g"
)

Arguments

data

A data frame with the categorical variables to be used be the model.

ntypes

An integer indicating the number of pure type probabilities to be estimated.

alpha

An array with the pure type probabilities. If specified, the model will not estimate alpha and will only use the array provided by user.

burnin

Number of iterations for the Markov chain achieve a stationary distribution.

ngibbs

Number of iterations after the Markov chain achieved a stationary distribution.

omega

The tuning parameter for the Metropolis–Hastings step.

eta

The tuning parameter of the conditional Dirichlet distribution of Xi.

tau

The shape parameter of the prior Gamma distribution for alpha.

beta

The inverse scale parameter of the prior Gamma distribution for alpha.

gomscores

Prefix for the gamma column names.

Value

An object of class gom_bayes with the posterior distributions of gamma, lambda, Xi, and alpha.

Examples


data <- data.frame(x1 = round(stats::runif(n = 50, 1, 2), 0),
                   x2 = round(stats::runif(n = 50, 1, 3), 0),
                   x3 = round(stats::runif(n = 50, 1, 4), 0))

gom::gom_bayes(data, ntypes = 2, ngibbs = 250, burnin = 250)


epopea/gom documentation built on March 1, 2023, 1:54 a.m.