posterior: Posterior class-membership probabilities and modal class...

posteriorR Documentation

Posterior class-membership probabilities and modal class assignments

Description

posterior() returns the n x T matrix of posterior class-membership probabilities used by a fitted model; classes() returns the modal (most likely) class of each observation.

Usage

posterior(object, ...)

## S3 method for class 'tseLCA'
posterior(object, ...)

classes(object, ...)

## S3 method for class 'tseLCA'
classes(object, ...)

Arguments

object

A fitted tseLCA object.

...

Further arguments (currently unused).

Value

posterior(): a numeric n x T matrix. classes(): an integer vector of length n with values in ⁠1..T⁠.

Examples

d   <- generate_data(200, "high", "covariate", seed = 1)
fit <- three_step(d, paste0("Y", 1:6), n_classes = 3,
                  Zp.names = "Zp", use.simple.cov = TRUE)
head(posterior(fit))
table(classes(fit))

tseLCA documentation built on Nov. 11, 2026, 9:07 a.m.