predict.summary.ddt_lcm {ddtlcm}R 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)

[Package ddtlcm version 0.2.1 Index]