Learn R Programming

ProfileGLMM (version 1.1.0)

theta_init: Initialize the variables for the Gibbs sampler chain

Description

This function generates initial values (theta) for all parameters in the Profile GLMM Gibbs sampler by drawing from the specified prior distributions. These initial values are crucial for starting the MCMC chain in profileGLMM_Gibbs. The initialization includes parameters for fixed effects, random effects variance, latent effects, and the profile cluster parameters (centroids, covariances, and categorical probability vectors).

Usage

theta_init(prior, params)

Value

A list (theta) containing the sampled initialization values for the Gibbs sampler. Key elements include:

sig2:

Initial residual variance.

betaFE:

Initial fixed effects coefficients.

SigRE:

Initial random effects covariance matrix.

SigLat:

Initial latent effects covariance matrix.

gammaLat:

Initial latent effects coefficients, organized by cluster.

ClusCont:

List containing initial continuous cluster parameters (mu and Sigma).

ClusCat:

List containing initial categorical cluster parameters (pvecClus).

Arguments

prior

A list containing the prior configuration to draw initialization from. This list should match the structure produced by the prior_init function, including hyperparameters for FE, RE, Latent, and cluster assignment priors.

params

A list containing the problem's dimensional parameters and indices (e.g., number of observations, number of covariates). This list should match the structure of the output from process_Data_outcome.

Examples

Run this code
# Load dataProfile, the result of profileGLMM_preProcess()
data("examp")
dataProfile = examp$dataProfile
theta = theta_init(dataProfile$prior,dataProfile$params)

Run the code above in your browser using DataLab