predict.ddt_lcm {ddtlcm}R Documentation

Prediction of class memberships from posterior predictive distributions

Description

Predict individual class memberships based on posterior predictive distributions. For each posterior sample, let the class memberships be modal assignments. Then aggregate over all posterior samples to obtain the most likely assigned classes.

Usage

## S3 method for class 'ddt_lcm'
predict(object, data, burnin = 3000, ...)

Arguments

object

a 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

burnin

number of samples to discard from the posterior chain as burn-ins. Default is 3000.

...

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
predicted <- predict(result_diet_1000iters, result_diet_1000iters$data, burnin)

[Package ddtlcm version 0.2.1 Index]