LSBP_Gibbs: Gibbs sampling algorithm for the LSBP model

Description Usage Arguments Details Value Examples

Description

The dependent logit stick-breaking process (LSBP) model estimated through the Gibbs sampling.

Usage

1
2
LSBP_Gibbs(Formula, data, H, prior, control = control_Gibbs(),
  verbose = TRUE)

Arguments

Formula

An object of class Formula: a symbolic description of the model to be fitted. The details of model specification are given under 'Details'.

data

A data frame containing the variables of Formula.

H

An integer indicating the number of mixture components.

prior

A list of prior hyperparameters as returned by prior_LSBP. If missing, default prior values are used.

control

A list as returned by control_Gibbs.

verbose

A logical value indicating whether additional information should be displayed while the algorithm is running.

Details

The Formula specification contains the response, separated from the covariates with the symbol '~', and two sets of covariates. The latters are separated by the symbol '|', indicating the kernel covariates and the mixing covariates, respectively. For example, one could specify y ~ x1 + x2 | x3 + x4. NOTE: if the second set of covariates is omitted it is assumed that the two sets are the same.

If offsets or weights are provided in the Formula they will be ignored in the current version. A predict method is available and described at predict.LSBP_Gibbs.

Value

The output is an object of class 'LSBP_Gibbs' containing the following quantities:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
data(cars)

# A model with constant kernels
fit_gibbs <- LSBP_Gibbs(dist ~  1 | speed, data=cars, H=4)
plot(cars) 
lines(cars$speed,colMeans(predict(fit_gibbs)))

# A model with linear kernels
fit_gibbs <- LSBP_Gibbs(dist ~ speed | speed, data=cars, H=2)
plot(cars) 
lines(cars$speed,colMeans(predict(fit_gibbs)))

## End(Not run)

blindedmanuscript/LSBP documentation built on May 13, 2019, 8:23 a.m.