Nothing
test_that("b26 Swissmetro triangular panel mixture matches native Biogeme", {
skip_if_not(identical(Sys.getenv("RBIOGEME_RUN_INTEGRATION"), "1"), "Set RBIOGEME_RUN_INTEGRATION=1 to run full Swissmetro equivalence tests")
skip_if_not(rbiogeme_test_configure_python(), "Set RBIOGEME_PYTHON to a compatible native Biogeme interpreter")
data_path <- rbiogeme_test_swissmetro_path()
skip_if(!nzchar(data_path), "Set RBIOGEME_SWISSMETRO_DATA to the Swissmetro .dat file")
data <- read.delim(data_path, check.names = FALSE, stringsAsFactors = FALSE)
r_model <- r_swissmetro_mixture(data, "b26", number_of_draws = 256L)$model
temporary_directory <- tempfile("rbiogeme-b26-")
dir.create(temporary_directory, recursive = TRUE)
original_directory <- getwd()
setwd(temporary_directory)
on.exit(setwd(original_directory), add = TRUE)
r_fit <- estimate(r_model, model_name = "b26_triangular_panel_mixture", control = r_model$control)
native <- native_swissmetro_mixture(data, "b26", number_of_draws = 256L)
expect_equal(nobs(r_fit), native$results$sample_size)
expect_identical(r_fit$beta_names, native$results$beta_names)
expect_equal(unname(coef(r_fit)), native$results$beta_values, tolerance = 2e-7)
expect_equal(as.numeric(logLik(r_fit)), native$results$final_log_likelihood, tolerance = 2e-7)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.