predict.summary.ddt_lcm: Prediction of class memberships from posterior summaries

View source: R/predict.R

predict.summary.ddt_lcmR Documentation

Prediction of class memberships from posterior summaries

Description

Predict individual class memberships based on posterior summary (point estimates of model parameters). The predicted class memberships are modal assignments.

Usage

## S3 method for class 'summary.ddt_lcm'
predict(object, data, ...)

Arguments

object

a "summary.ddt_lcm" object

data

an NxJ matrix of multivariate binary responses, where N is the number of individuals, and J is the number of granular items

...

Further arguments passed to each method

Value

a list of the following named elements:

class_assignments

an integer vector of individual predicted class memberships taking values in 1, ..., K

predictive_probs

a N x K matrix of probabilities, where the (i,k)-th element is the probability that the i-th individual is predicted to belong to class k.

Examples

data(result_diet_1000iters)
burnin <- 500
summarized_result <- summary(result_diet_1000iters, burnin, relabel = TRUE, be_quiet = TRUE)
predicted <- predict(summarized_result, result_diet_1000iters$data)

ddtlcm documentation built on May 29, 2024, 5:41 a.m.