hdpGLM_simulateData | R Documentation |
Simulate a Data Set from hdpGLM
hdpGLM_simulateData(
n,
K,
nCov = 2,
nCovj = 0,
J = 1,
family = "gaussian",
parameters = NULL,
pi = NULL,
same.K = FALSE,
seed = NULL,
context.effect = NULL,
same.clusters.across.contexts = NULL,
context.dependent.cluster = NULL
)
n |
integer, the sample size of the data. If there are multiple contexts, each context will have n cases. |
K |
integer, the number of clusters. If there are multiple contexts, K is the average number of clusters across contexts, and each context gets a number of clusters sampled from a Poisson distribution, except if |
nCov |
integer, the number of covariates of the GLM components. |
nCovj |
an integer indicating the number of covariates determining the average parameter of the base measure of the Dirichlet process prior |
J |
an integer representing the number of contexts @param parameters either NULL or a list with the parameters to generate the model. If not NULL, it must contain a sublist name beta, a vector named tau, and a vector named pi. The sublist beta must be a list of vectors, each one with size nCov+1 to be the coefficients of the GLM mixtures components that will generate the data. For the vector tau, if nCovj=0 (single-context case) then it must be a 1x1 matrix containing 1. If nCovj>0, it must be a (nCov+1)x(nCovj+1) matrix. The vector pi must add up to 1 and have length K. |
family |
a character with either 'gaussian', 'binomial', or 'multinomial'. It indicates the family of the GLM components of the mixture model. |
parameters |
a list with the parameter values of the model. Format should be the same of the output of the function hdpGLM_simulateParameters() |
pi |
either NULL or a vector with length K that add up to 1. If not NULL, it determines the mixture probabilities |
same.K |
boolean, used when data is sampled from more than one context. If |
seed |
a seed for |
context.effect |
either |
same.clusters.across.contexts |
boolean, if |
context.dependent.cluster |
integer, indicates which cluster will be context-dependent. If |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.