sample.z.mixmod: Internal function to sample latent clusters (for...

View source: R/mixmod_gibbs_functions.R

sample.z.mixmodR Documentation

Internal function to sample latent clusters (for observations)

Description

This function samples the latent z parameter within the Gibbs sampler. Calls on the rmultinom1 function written in C++. Not for calling directly by users.

Usage

sample.z.mixmod(nobs, nmaxclust, dat, ltheta, lphi, ndata.types)

Arguments

nobs

numeric. The total number of rows in the dataset.

nmaxclust

numeric. A single number indicating the maximum number of clusters to test.

dat

A data frame containing only columns of the discretized data streams for all observations.

ltheta

numeric. A vector of log-transformed estimates for parameter theta.

lphi

A list containing log-transformed estimates for each data stream of the phi parameter.

ndata.types

numeric. The number of data streams being analyzed.

Value

A vector with estimates for z for each observation within dat.


joshcullen/bayesmove documentation built on Oct. 6, 2023, 3:28 a.m.