View source: R/model_fitting.R
fit_model | R Documentation |
This function performs Markov chain Monte Carlo simulation for fitting different types of probit models (binary, multivariate, mixed, latent class, ordered, ranked) to discrete choice data.
fit_model(
data,
scale = "Sigma_1,1 := 1",
R = 1000,
B = R/2,
Q = 1,
print_progress = getOption("RprobitB_progress"),
prior = NULL,
latent_classes = NULL,
seed = NULL,
fixed_parameter = list()
)
data |
An object of class |
scale |
A character which determines the utility scale. It is of the form
|
R |
The number of iterations of the Gibbs sampler. |
B |
The length of the burn-in period, i.e. a non-negative number of samples to be discarded. |
Q |
The thinning factor for the Gibbs samples, i.e. only every |
print_progress |
A boolean, determining whether to print the Gibbs sampler progress and the estimated remaining computation time. |
prior |
A named list of parameters for the prior distributions. See the documentation
of |
latent_classes |
Either
|
seed |
Set a seed for the Gibbs sampling. |
fixed_parameter |
Optionally specify a named list with fixed parameter values for |
See the vignette on model fitting for more details.
An object of class RprobitB_fit
.
prepare_data()
and simulate_choices()
for building an
RprobitB_data
object
update()
for estimating nested models
transform()
for transforming a fitted model
data <- simulate_choices(
form = choice ~ var | 0, N = 100, T = 10, J = 3, seed = 1
)
model <- fit_model(data = data, R = 1000, seed = 1)
summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.