bmixlm | R Documentation |
Fits a binary mixture of linear models in which the probability of class membership is related to the covariates through a probit regression model.
bmixlm(
formula1,
formula2,
formulap,
data,
nsamp = 1000,
nthin = 3,
tau.prior = c(0.01, 0.01),
start = list(sigma = c(1e-04, 1e-04))
)
formula1 |
An object of class formula: a symbolic description of the linear model for the first component |
formula2 |
An object of class formula: a symbolic description of the linear model for the second component |
formulap |
An object of class formula: a symbolic description of the probit model for the probability an observation is |
data |
A dataframe containing the variables from the model. |
nsamp |
Number of samples to draw. |
nthin |
The thinning rate. |
tau.prior |
Parameters of the (common) Gamma prior for the precision of the two models. |
start |
A list of initial values for sigma, betap and b |
The model assumes the observations are drawn from a two component mixture, where each component is described by a different linear model. The probability that an individual observation is a member of one component or the other is modelled by a probit regression.
The model is fit by Gibbs sampling, assuming uniform priors for the regression coefficients of the two linear model and the probit regression, and a (common) Gamma prior for the precision (inverse variance) of the two linear models. The probit component of the model is sampled by the method of Albert and Chib.
An object of class bmixlm
with columns
call: the matched call
nsamp: the number of samples retained after thinning
beta1: matrix of samples of the coefficients of the first linear model
beta2: matrix of samples of the coefficients of the second linear model
betap: matrix of samples of the coefficients of the probit model
sigma: two column matrix of samples of the standard deviations of the errors for the two models
data: the input dataframe
pW: effective degrees of freedom for the fitted model
WAIC: WAIC for the fitted model
restart: final sigma, betap and b for restart purposes
Albert, J. H., & Chib, S. (1993). Bayesian analysis of binary and polychotomous response data. Journal of the American statistical Association, 88(422), 669-679.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.