Rcpp implementation for sampling household data without constraints.
samplehouseholds(phi, omega, pi, d, lambda, currrentbatch, nHouseholds, householdsize,
HeadAtGroupLevel, Parallel)
Matrix of posterior samples for the individual-level probabilities for each individual-level variable by each pair of group-level and individual-level latent classes.
Matrix of the probabilities for the individual-level latent classes by the group-level latent classes.
Vector of the probabilities for the group-level latent classes.
Vector containing the number of levels for each of the indiviual-level variables.
A list of matrices of the group-level probabilities for each group-level variable by the group-level latent classes. Each matrix in the list is for each group-level variable.
The current batch number for the household data to be generated. The household ID will be generated based on this batch number.
The number of households to be generated by one call to this function.
The size of the households to be generated.
Logical indicator for running the model that codes household head at the group level.
Logical indicator for running the function in parallel mode.
A data matrix with each row for one household.
This function allows the model to generate a batch of nHouseholds
with each household of size householdsize
. The generated household data will include both possible and impossible households. Use samplehouseholds
when the household head is included as an individual within the household.