classify: Predicted Probabilities of Component Membership

View source: R/bmixlm.R

classifyR Documentation

Predicted Probabilities of Component Membership

Description

Predict probabilities of component membership for a new data set.

Usage

classify(object, type = c("mean", "samples"), data = NULL)

Arguments

object

An object of class bmixlm

type

Whether to return the posterior means or samples from the posterior.

data

A dataframe for which predictions are required.

Details

For each row in the dataframe data, predict

  • p: the posterior predictive probability of membership of the second component (conditional only on the observed covariates in the prediction data set)

  • p: the posterior probability of membership of the second component (conditional on both the observed response and covariates in the prediction data set)

If type="mean" the function returns posterior means as a dataframe, otherwise it returns samples from the posterior as a list of arrays.

Value

Returns a list or dataframe with elements

  • p: posterior predictive probabilities of membership of the second component

  • q: posterior probabilities of membership of the second component

If type="mean" return a dataframe of posterior means is returned, and if type="samples" return a list of arrays of samples from the posterior.


SWotherspoon/bmixlm documentation built on June 10, 2025, 6:47 a.m.