predictAll: Predicted Values for a 'bmixlm' Object

Description Usage Arguments Details Value

Description

Return the full range of predicted values that can be computed from the model when the responses are available for the prediction data set.

Usage

1
2
predictAll(object, type = c("mean", "samples"), data = NULL,
  standardize = FALSE, ...)

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

standardize

Whether to standardize the residuals.

...

Currently unused.

Details

This function returns the predicted values that are conditional only on the responses for the data to which the model is fitted:

together with the predicted values conditional on the responses from both the data to which the model is fitted, and the prediction data set:

The posterior predictive probability p predicts the probability that a new response will be drawn from the second component, the posterior probability q predicts the probability that the observed response was drawn from the second component.

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

y

vector of responses from data

y1

predicted values for the first component model

y2

predicted values for the second component model

r1

residuals for the first component model

r2

residuals for the second component model

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 May 9, 2019, 12:07 p.m.