From 30521b80601d3842c199ca54e861e002881096f9 Mon Sep 17 00:00:00 2001 From: Sebastian Weber Date: Thu, 21 Nov 2024 13:06:24 +0100 Subject: [PATCH] do not run lengthy predicitve ess elir demonstration in non-interactive mode --- inst/examples/ess.R | 15 +++++++++------ tools/make-ds.R | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/inst/examples/ess.R b/inst/examples/ess.R index da70031..264acba 100644 --- a/inst/examples/ess.R +++ b/inst/examples/ess.R @@ -24,12 +24,15 @@ round(sum(ab_matched)) ess(bmix, method="morita") # Predictive consistency of elir -n_forward <- 1E2 -bmixPred <- preddist(bmix, n=n_forward) -pred_samp <- rmix(bmixPred, 1E3) -pred_ess <- sapply(pred_samp, function(r) ess(postmix(bmix, r=r, n=n_forward), "elir") ) -ess(bmix, "elir") -mean(pred_ess) - n_forward +if(interactive()) { + # takes a moment to run + n_forward <- 1E2 + bmixPred <- preddist(bmix, n=n_forward) + pred_samp <- rmix(bmixPred, 1E3) + pred_ess <- sapply(pred_samp, function(r) ess(postmix(bmix, r=r, n=n_forward), "elir") ) + ess(bmix, "elir") + mean(pred_ess) - n_forward +} # Normal mixture example nmix <- mixnorm(rob=c(0.5, 0, 2), inf=c(0.5, 3, 4), sigma=10) diff --git a/tools/make-ds.R b/tools/make-ds.R index a06c447..0013846 100644 --- a/tools/make-ds.R +++ b/tools/make-ds.R @@ -43,7 +43,7 @@ make_internal_ds <- function() { calibration_meta["MD5"] <- vals["MD5"] pkg_create_date <- Sys.time() - pkg_sha <- "bd767e7" + pkg_sha <- "3377b7c" if (gsub("\\$", "", pkg_sha) == "Format:%h") { pkg_sha <- system("git rev-parse --short HEAD", intern=TRUE)