mixedMemModelMCMC: Constructor for a Mixed Membership Model object which can be...

Description Usage Arguments Details Value

Description

Constructor for a mixedMemModelMCMC object which can be fit using MCMC in the mixedMem package.

Usage

1
2
3
mixedMemModelMCMC(Total, J, dist, Rj = rep(1, J), Vj, obs, K, theta, alpha0,
  ksi, lambda = NULL, Z = NULL, tau, beta, gamma, extended = 0,
  P = NULL, S = NULL, fixedObs = NULL)

Arguments

Total

the number of individuals in the sample.

J

the number of variables observed on each individual.

dist

a vector of length J specifying variable types. Options are "bernoulli" or "multinomial" corresponing to the distributions of the observed variables.

Rj

a vector of length J specifying the number of repeated measurements for each variable.

Vj

a vector of length J specifying the number of possible responses for each variable. For a Bernoulli variable Vj[j] = 1.

obs

an array with dimensions (Total,J,max(Rj)) corresponding to the observed data. For Bernoulli random variables, the data consist of 0/1's. For multinomial the data consist of integers 0,1,...,(Vj[j]-1).

K

the number of sub-populations.

theta

an array with dimensions (J,K,max(Vj)) which governs the variable distributions. The parameter theta[j,k,] governs the distribution of variable J for a complete member of sub-population k. For instance, if variable j is a Bernoulli variable, theta[j,k,1] is the probability of success; if variable j is a multinomial variable, theta[j,k, 1:Vj[j]] is the probability for each of the Vj[j] categories. Since the dimension of the relevant parameters can differ across variables, any unused elements of the array should be set to 0, while all other elements should be positive.

ksi

a vector which lies in the K-1 simplex which represents the relative frequency of each sub-population

lambda

a matrix with dimensions (Total, K) which represent the partial membership for individual i in group k

Z

an array with dimensions (Total,J,max(Rj)) which represents the sub-population according to which individual i responded to the r repitition of variable j

tau

an array of dimension (J, K, max(2, max(Vj))) which holds the prior parameters for each of the theta parameters. Note that for Bernoulli variables, even though Vj = 1, both parameters of the beta must be specified so we still require 2 values

beta

shape parameter for prior for alpha

gamma

scale parameter for prior for alpha

extended

1 indicates the extended GoM model is being used; 0 indicates the normal mixed membership model without fixed stayers

P

vector of length S + 1 which lies in S dimensional simplex indicating the proportion of individuals in the fixed groups and GoM compartment. The first S elements correspond to the stayer classes, while the S + 1 element indicates the proportion of individuals in GoM compartment

S

integer indicating the number of fixed stayer classes if extended GoM is used.

fixedObs

an array with dimensions (S, J, max(Rj)) corresonding to the observed responses for a fixed group in the extended GoM model from Erosheva et al (2007).

alpha

a scalar representing the sum of the dirichlet membership parameters

Details

The function returns an object of mixedMemModelMCMC class. This object contains dimensions of the model, the observed data, and the model parameters. Once a mixedMemModel object is created, the specified model can be fit for the data using the mmMCMCFit function. If the inputs are inconsistent (ie if dimensions do not match, or if observations and distribution types are not compatible, mixedMemModelMCMC will throw an error. Supported data types include Bernoulli and Multinomial (Note that rank data is not supported in the MCMC method). The MCMC method is capable of also estimating the extended GoM model which allows for a fixed number of "stayers". See Erosheva et al (2007) for a detailed description of the extended GoM Model. For additional details on usage, and model assumptions, see the corresponding vignette "Fitting Mixed Membership Models Using mixedMem".

Value

returns an object of class mixedMemModelMCMC.


ysamwang/mixedMem documentation built on May 4, 2019, 5:33 p.m.