Skip to content

Commit

Permalink
do not run lengthy predicitve ess elir demonstration in non-interacti…
Browse files Browse the repository at this point in the history
…ve mode
  • Loading branch information
weberse2 committed Nov 21, 2024
1 parent 69bc5f3 commit 30521b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions inst/examples/ess.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tools/make-ds.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 30521b8

Please sign in to comment.