Skip to contents

Welcome to {RprobitB}1, an R package for Bayesian estimation of the probit model.

The package purpose

  1. With {RprobitB}, you can model the choices made by deciders among a discrete set of alternatives. For example, think of tourists that want to book a flight to their holiday destination. The knowledge why they prefer a certain route over another is of great value for airlines, especially the customer’s willingness to pay for say a faster or more comfortable flight alternative.

  2. Different deciders value different choice attributes differently. For example, it is imaginable that business people place a higher value on flight time and are willing to pay more for a faster route alternative than vacationers. Such choice behavior heterogeneity can be addressed by {RprobitB}. Furthermore, the package enables to identify groups of deciders that share similar preferences.

  3. Finally, the package enables prediction of choice behavior when certain choice attributes change, for example the proportion of customers who will choose the competitor’s product in the event of a price increase.

The workflow

The functions of {RprobitB} can be grouped into ones for data management, model fitting, and model evaluation, see the flowchart below. The package can be used for two different purposes: (a) estimation of a model for given data and (b) estimation of a model for simulated data. Simulation typically serves to assess the properties of estimation algorithms either for research or in a bootstrap like fashion. {RprobitB} supports these functions.

A typical workflow is as follows:

  1. Prepare a choice data set via the prepare_data() function or simulate data via simulate_choices() (true model parameters can be set as an RprobitB_parameter object). Both functions return an RprobitB_data object that can be fed into the estimation routine. The train_test() allows to optionally split the data into an estimation and a validation part. See the vignette on choice data for details.

  2. The estimation routine is called mcmc() (for Markov chain Monte Carlo) and returns an RprobitB_fit object. The transform_fit() function allows to change normalization of the model after a model has been fitted. See the vignettes on model fitting and on modeling heterogeneity.

  3. The RprobitB_fit object can be fed into coef() to show the covariate effects on the choices and into predict() to compute choice probabilities and forecast choice behavior if choice characteristics would change, see the vignette on choice prediction.

  4. The function model_selection() compares arbitrary many competing RprobitB_fit objects by computing different model selection criteria, see the vignette on model selection.

The flowchart of {RprobitB}.

Printing the progress of computations

Per default, any function in {RprobitB} that takes more than a few seconds evaluation time prints the progress of the computations to the console. To hide these progress messages, set options("RprobitB_progress" = FALSE). To show them again, set options("RprobitB_progress" = TRUE).