gom_bayes | R Documentation |
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.
gom_bayes( data, ntypes = 2, alpha = "", burnin = 250, ngibbs = 250, omega = 50, eta = 10, tau = 2, beta = 2, gomscores = "g" )
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. |
An object of class gom_bayes with the posterior distributions of gamma, lambda, Xi, and alpha.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.