validate_model: Validate a model before estimation

View source: R/model.R

validate_modelR Documentation

Validate a model before estimation

Description

Model construction, database operations, and native Biogeme model creation are checked without running an optimizer or writing estimation results. The returned diagnostics are ordinary R values; the native model object is created and discarded inside the bridge.

Usage

validate_model(model, control = NULL)

Arguments

model

A biogeme_model.

control

Optional biogeme_control() object. It is used only when native model construction needs a control value.

Details

This is specification validation, not cross-validation. Use validate() after estimation when the goal is out-of-sample fold evaluation.

Value

An object of class biogeme_model_validation containing the native validation status, database information, formula names, and parameter count.

Examples

## Not run: 
database <- biogeme_database(
  "demo",
  data.frame(choice = c(1, 2), x = c(1, 2))
)
model <- logit_model(
  database,
  choice = "choice",
  utilities = list(`1` = 0, `2` = biogeme_beta("b") * variable("x"))
)
validate_model(model)

## End(Not run)

rbiogeme documentation built on Sept. 29, 2026, 5:09 p.m.