==2811947== Memcheck, a memory error detector ==2811947== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. ==2811947== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info ==2811947== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==2811947== R Under development (unstable) (2026-06-29 r90198) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "ernest" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('ernest') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("as_draws.ernest_run") > ### * as_draws.ernest_run > > flush(stderr()); flush(stdout()) > > ### Name: as_draws.ernest_run > ### Title: Transform nested sampling runs to 'draws' objects > ### Aliases: as_draws.ernest_run as_draws_rvars.ernest_run > ### as_draws_matrix.ernest_run > > ### ** Examples > > library(posterior) This is posterior version 1.7.0 Attaching package: ‘posterior’ The following objects are masked from ‘package:stats’: mad, sd, var The following objects are masked from ‘package:base’: %in%, match > data(example_run) > > # View importance weights > dm <- as_draws(example_run) > str(dm) 'draws_matrix' num [1:10353, 1:4] -8.05 -7.27 9.1 -8.81 -9.44 ... - attr(*, "dimnames")=List of 2 ..$ draw : chr [1:10353] "1" "2" "3" "4" ... ..$ variable: chr [1:4] "x" "y" "z" ".log_weight" - attr(*, "nchains")= int 1 > weights(dm) |> head() [1] 4.626832e-59 4.642903e-57 2.136511e-56 3.407974e-56 5.357244e-56 [6] 5.713593e-55 > > # Summarise points after resampling > dm |> + resample_draws() |> + summarize_draws() # A tibble: 3 × 10 variable mean median sd mad q5 q95 rhat ess_bulk ess_tail 1 x -0.00288 -0.0193 0.964 0.963 -1.55 1.60 1.19 4020. 13.0 2 y 0.00930 0.0200 0.978 0.976 -1.61 1.63 1.18 3723. 12.8 3 z -0.0396 -0.0523 0.998 1.02 -1.63 1.61 1.19 4231. 12.9 > > # Extract the same coordinates in the unit space coordinates > dm_unit <- as_draws_rvars(example_run, units = "unit_cube") > str(dm_unit) List of 4 $ x : rvar<10353>[1] 0.5 ± 0.14 $ y : rvar<10353>[1] 0.5 ± 0.14 $ z : rvar<10353>[1] 0.5 ± 0.14 $ .log_weight: rvar<10353>[1] -18 ± 18 - attr(*, "class")= chr [1:3] "draws_rvars" "draws" "list" > > > > cleanEx() detaching ‘package:posterior’ > nameEx("calculate.ernest_run") > ### * calculate.ernest_run > > flush(stderr()); flush(stdout()) > > ### Name: calculate.ernest_run > ### Title: Estimate Evidence using a Nested Sampling Run > ### Aliases: calculate.ernest_run ernest_estimate > > ### ** Examples > > # Load an example run > data(example_run) > > # View results and analytical evidence errors. > calculate(example_run, ndraws = 0) # A tibble: 10,353 × 4 log_lik log_volume log_weight log_evidence 1 -137. -0.001 ± NA -143 ± NA -143 ± 0 2 -132. -0.002 ± NA -139 ± NA -139 ± 0 3 -130. -0.003 ± NA -137 ± NA -137 ± 0 4 -130. -0.004 ± NA -137 ± NA -136 ± 0 5 -129. -0.005 ± NA -136 ± NA -136 ± 0 6 -127. -0.006 ± NA -134 ± NA -134 ± 0 7 -124. -0.007 ± NA -131 ± NA -131 ± 0 8 -123. -0.008 ± NA -130 ± NA -130 ± 0 9 -123. -0.009 ± NA -130 ± NA -129 ± 0 10 -122. -0.010 ± NA -129 ± NA -128 ± 0 # ℹ 10,343 more rows > > # Simulate 100 log-volume shrinkage sequences across the run. > calculate(example_run, ndraws = 100) # A tibble: 10,353 × 4 log_lik log_volume log_weight log_evidence 1 -137. -0.00088 ± 0.00081 -144 ± 0.80 -144 ± 0.80 2 -132. -0.00176 ± 0.00111 -139 ± 0.74 -139 ± 0.72 3 -130. -0.00285 ± 0.00145 -137 ± 0.77 -137 ± 0.64 4 -130. -0.00377 ± 0.00164 -137 ± 0.86 -136 ± 0.59 5 -129. -0.00483 ± 0.00205 -137 ± 0.86 -136 ± 0.57 6 -127. -0.00572 ± 0.00229 -134 ± 0.86 -134 ± 0.71 7 -124. -0.00662 ± 0.00257 -132 ± 0.82 -132 ± 0.76 8 -123. -0.00763 ± 0.00262 -130 ± 0.97 -130 ± 0.70 9 -123. -0.00881 ± 0.00304 -130 ± 0.94 -129 ± 0.66 10 -122. -0.00987 ± 0.00322 -129 ± 0.85 -128 ± 0.59 # ℹ 10,343 more rows > > > > > cleanEx() > nameEx("compile-ernest") > ### * compile-ernest > > flush(stderr()); flush(stdout()) > > ### Name: compile.ernest_sampler > ### Title: Compile the live set of points for nested sampling > ### Aliases: compile.ernest_sampler compile.ernest_run > > ### ** Examples > > prior <- create_uniform_prior(lower = c(-1, -1), upper = 1) > ll_fn <- function(x) -sum(x^2) > sampler <- ernest_sampler(ll_fn, prior, nlive = 100) > > # Compile the sampler to add a live set > compile(sampler) Nested sampling run specification: * No. points: 100 * Sampling method: 25-step random walk sampling (acceptance target = 50%) * Prior: uniform prior distribution with 2 dimensions (Uniform_1 and Uniform_2) > head(sampler$live_env$unit) [,1] [,2] [1,] 0.8718050 0.51675016 [2,] 0.9671970 0.65804858 [3,] 0.8669163 0.58839658 [4,] 0.4377153 0.07992458 [5,] 0.1919378 0.15613625 [6,] 0.0822944 0.98508137 > > # Continue a previous run > > # Make a new sampler from a previous run > sampler_3 <- compile(example_run, clear = TRUE) > sampler_3 Nested sampling run specification: * No. points: 1000 * Sampling method: 25-step random walk sampling (acceptance target = 50%) * Prior: uniform prior distribution with 3 dimensions (x, y, and z) > > > > cleanEx() > nameEx("create_likelihood") > ### * create_likelihood > > flush(stderr()); flush(stdout()) > > ### Name: create_likelihood > ### Title: Prepare a likelihood function for nested sampling > ### Aliases: create_likelihood ernest_likelihood > > ### ** Examples > > library(mvtnorm) > > # Multivariate Normal Distribution > m <- 3 > mean <- rep(0, m) > sigma <- diag(m) > sigma[2, 1] <- sigma[1, 2] <- 3 / 5 > sigma[3, 1] <- sigma[1, 3] <- 1 / 3 > sigma[3, 2] <- sigma[2, 3] <- 11 / 15 > prec <- solve(sigma) > log_det <- -sum(log(diag(chol(sigma)))) > > # Provide a Scalar Log-Likelihood Function: > log_lik <- function(x) { + log_det - 0.5 * m * log(2 * pi) - 0.5 * (t(x) %*% prec %*% x) + } > log_lik(c(0, 0, 0)) [,1] [1,] -2.128207 > > # `create_likelihood` allows scalar fns. to accept matrix inputs: > try(log_lik(matrix(rep(0, m * 2), nrow = 2))) Error in t(x) %*% prec : non-conformable arguments > scalar_ll <- create_likelihood(scalar_fn = log_lik) > scalar_ll(matrix(rep(0, m * 2), nrow = 2)) [1] -2.128207 -2.128207 > > # Provide a Vectorized Log-Likelihood Function: > v_log_lik <- function(x) { + dmvnorm(x, mean = mean, sigma = sigma, log = TRUE) + } > v_log_lik(c(0, 0, 0)) [1] -2.128207 > v_log_lik(matrix(rep(0, m * 2), nrow = 2)) [1] -2.128207 -2.128207 > > vector_ll <- create_likelihood(vectorized_fn = v_log_lik) > vector_ll Vectorized Log-likelihood Function function (x) { dmvnorm(x, mean = mean, sigma = sigma, log = TRUE) } > > # Control Behaviour when Nonfinite Likelihood Values are Encountered > # Default: Warn and replace with `-Inf` > vector_ll(c(0, 0, NA)) Warning: Replacing `NA` with `-Inf`. [1] -Inf > > # Signal an error > abort_ll <- create_likelihood(log_lik, on_nonfinite = "abort") > try(abort_ll(c(0, 0, NA))) Error : Couldn't calculate the log-lik of 0, 0, and NA. Caused by error: ! log-lik. values must be either finite or `-Inf`. ✖ Detected non-viable value: `NA`. > > # Silently replace all non-finite values > quiet_ll <- create_likelihood(vectorized_fn = v_log_lik, on_nonfinite = "quiet") > quiet_ll(c(0, 0, NA)) [1] -Inf > > > > cleanEx() detaching ‘package:mvtnorm’ > nameEx("create_prior") > ### * create_prior > > flush(stderr()); flush(stdout()) > > ### Name: create_prior > ### Title: Prepare a prior transformation for nested sampling > ### Aliases: create_prior ernest_prior +.ernest_prior > > ### ** Examples > > # Specify a prior with independent marginals > normal <- create_normal_prior( + names = c("beta0", "beta1", "beta2"), + mean = 0, + sd = 5 + ) > uniform <- create_uniform_prior(names = "sd", lower = 0, upper = 5) > composite <- normal + uniform > composite composite prior distribution with 4 dimensions (beta0, beta1, beta2, and sd) > > # Propose a conditional (hierarchical) prior in vectorized form > fn <- function(x) { + n <- nrow(x) + out <- matrix(NA_real_, nrow = n, ncol = 3) + # x[1] follows N(5, 1) + out[, 1] <- stats::qnorm(x[, 1], mean = 5, sd = 1) + # log10(x[2]) follows Uniform(-1, 1) + out[, 2] <- 10^stats::qunif(x[, 2], min = -1, max = 1) + # x[3] follows N(x[1], x[2]) + out[, 3] <- stats::qnorm(x[, 3], mean = out[, 1], sd = out[, 2]) + out + } > > conditional_prior <- create_prior( + vectorized_fn = fn, + names = c("mean", "sd", "x"), + lower = c(-Inf, 0, -Inf) + ) > > # Plot the marginals > sample <- conditional_prior$fn(matrix(runif(1000 * 3), nrow = 1000)) > hist(sample[, 1], main = "mean") > hist(sample[, 2], main = "sd") > hist(sample[, 3], main = "x") > > > > cleanEx() > nameEx("ernest_sampler") > ### * ernest_sampler > > flush(stderr()); flush(stdout()) > > ### Name: ernest_sampler > ### Title: Prepare a new nested sampling run > ### Aliases: ernest_sampler > > ### ** Examples > > prior <- create_uniform_prior(lower = c(-1, -1), upper = 1) > ll_fn <- function(x) -sum(x^2) > sampler <- ernest_sampler(ll_fn, prior, nlive = 100) > sampler Nested sampling run specification: * No. points: 100 * Sampling method: 25-step random walk sampling (acceptance target = 50%) * Prior: uniform prior distribution with 2 dimensions (Uniform_1 and Uniform_2) > > # Use a unit-cube LRPS (not recommended in practice) > unit_sampler <- ernest_sampler( + ll_fn, + prior, + nlive = 100, + sampler = unif_cube() + ) > unit_sampler Nested sampling run specification: * No. points: 100 * Sampling method: Uniform unit cube sampling * Prior: uniform prior distribution with 2 dimensions (Uniform_1 and Uniform_2) > > > > cleanEx() > nameEx("generate-ernest") > ### * generate-ernest > > flush(stderr()); flush(stdout()) > > ### Name: generate.ernest_sampler > ### Title: Run nested sampling to estimate Bayesian evidence > ### Aliases: generate.ernest_sampler ernest_run generate.ernest_run > > ### ** Examples > > prior <- create_uniform_prior(lower = c(-1, -1), upper = 1) > ll_fn <- function(x) -sum(x^2) > sampler <- ernest_sampler(ll_fn, prior, nlive = 100) > sampler Nested sampling run specification: * No. points: 100 * Sampling method: 25-step random walk sampling (acceptance target = 50%) * Prior: uniform prior distribution with 2 dimensions (Uniform_1 and Uniform_2) > > # Stop sampling after a set number of iterations or likelihood evaluations. > generate(sampler, max_iterations = 100) ⠙ Generating samples | 51 iter. | 68 log-lik. calls | 1.7617 log-evid. remaining ==2811947== Invalid read of size 8 ==2811947== at 0x1FD01F1D: operator[] (R-devel/site-library/cpp11/include/cpp11/r_vector.hpp:470) ==2811947== by 0x1FD01F1D: operator* (R-devel/site-library/cpp11/include/cpp11/r_vector.hpp:753) ==2811947== by 0x1FD01F1D: get_points(cpp11::r_vector, int, bool) (packages/tests-vg/ernest/src/exported_utils.cpp:23) ==2811947== by 0x1FCDD67F: _ernest_get_points (packages/tests-vg/ernest/src/cpp11.cpp:19) ==2811947== by 0x4A920D: R_doDotCall (svn/R-devel/src/main/dotcode.c:760) ==2811947== by 0x4E4243: bcEval_loop (svn/R-devel/src/main/eval.c:8700) ==2811947== by 0x4F42D7: bcEval (svn/R-devel/src/main/eval.c:7533) ==2811947== by 0x4F42D7: bcEval (svn/R-devel/src/main/eval.c:7518) ==2811947== by 0x4F460A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==2811947== by 0x4F659D: R_execClosure (svn/R-devel/src/main/eval.c:2398) ==2811947== by 0x4F725F: applyClosure_core (svn/R-devel/src/main/eval.c:2314) ==2811947== by 0x4F7CE1: Rf_applyClosure (svn/R-devel/src/main/eval.c:2333) ==2811947== by 0x53FCEB: dispatchMethod (svn/R-devel/src/main/objects.c:473) ==2811947== by 0x540350: Rf_usemethod (svn/R-devel/src/main/objects.c:513) ==2811947== by 0x540582: do_usemethod (svn/R-devel/src/main/objects.c:579) ==2811947== Address 0x1021d980 is 0 bytes after a block of size 848 alloc'd ==2811947== at 0x4843866: malloc (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:446) ==2811947== by 0x539541: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2894) ==2811947== by 0x53D50A: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:609) ==2811947== by 0x53D50A: R_allocResizableVector (svn/R-devel/src/main/memory.c:5072) ==2811947== by 0x1BB6C496: r_alloc_vector (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/./rlang/vec.h:188) ==2811947== by 0x1BB6C496: dbl_slice (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/slice.c:80) ==2811947== by 0x1BB6C496: vec_slice_base (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/slice.c:265) ==2811947== by 0x1BB6CA56: vec_slice_unsafe (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/slice.c:361) ==2811947== by 0x1BB6D14B: vec_init (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/slice.c:486) ==2811947== by 0x1BB28A70: list_combine_impl (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/list-combine.c:477) ==2811947== by 0x1BB2A268: list_combine_for_list_unchop (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/list-combine.c:202) ==2811947== by 0x1BB07F3C: vec_c (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/c.c:38) ==2811947== by 0x1BB07F3C: ffi_vec_c (/tmp/RtmplWvUzt/R.INSTALL699c06ac0a647/vctrs/src/c.c:24) ==2811947== by 0x4A768E: do_External (svn/R-devel/src/main/dotcode.c:573) ==2811947== by 0x4E638C: bcEval_loop (svn/R-devel/src/main/eval.c:8150) ==2811947== by 0x4F42D7: bcEval (svn/R-devel/src/main/eval.c:7533) ==2811947== by 0x4F42D7: bcEval (svn/R-devel/src/main/eval.c:7518) ==2811947== ⠙ Generating samples | 100 iter. | 158 log-lik. calls | 0.937327 log-evid. rema… Nested sampling run: * No. points: 100 * Sampling method: 25-step random walk sampling (acceptance target = 50%) * Prior: uniform prior distribution with 2 dimensions (Uniform_1 and Uniform_2) ── Results ───────────────────────────────────────────────────────────────────── * Iterations: 100 * Likelihood evals.: 158 * Log-evidence: -0.6612 (± 0.1318) * Information: 0.08494 > > # Use the default stopping criteria > > > > cleanEx() > nameEx("multi_ellipsoid") > ### * multi_ellipsoid > > flush(stderr()); flush(stdout()) > > ### Name: multi_ellipsoid > ### Title: Generate new points from multiple spanning ellipsoids > ### Aliases: multi_ellipsoid > > ### ** Examples > > data(example_run) > lrps <- multi_ellipsoid(enlarge = 1.25) ==2811947== Warning: invalid file descriptor -1 in syscall close() > > ernest_sampler(example_run$log_lik_fn, example_run$prior, sampler = lrps) Nested sampling run specification: * No. points: 500 * Sampling method: Uniform sampling within bounding ellipsoids (enlarged by 1.25) * Prior: uniform prior distribution with 3 dimensions (x, y, and z) > > > > cleanEx() > nameEx("plot-ernest") > ### * plot-ernest > > flush(stderr()); flush(stdout()) > > ### Name: plot.ernest_estimate > ### Title: Plot diagnostics from nested sampling results > ### Aliases: plot.ernest_estimate plot.ernest_run summary.ernest_estimate > > ### ** Examples > > # Plot diagnostics from a run (analytical uncertainty for evidence). > data(example_run) > plot(example_run) > > # Plot diagnostics from simulated log-volume trajectories. > set.seed(123) > est <- calculate(example_run, ndraws = 100) > plot(est) > > > > cleanEx() > nameEx("rwmh_cube") > ### * rwmh_cube > > flush(stderr()); flush(stdout()) > > ### Name: rwmh_cube > ### Title: Generate new points with a random walk > ### Aliases: rwmh_cube > > ### ** Examples > > # Basic usage with default parameters > lrps <- rwmh_cube() > > # A faster sampler for simple-to-traverse posterior surfaces > fast_lrps <- rwmh_cube( + steps = 20, + target_acceptance = 0.7 + ) > > > > > cleanEx() > nameEx("slice_rectangle") > ### * slice_rectangle > > flush(stderr()); flush(stdout()) > > ### Name: slice_rectangle > ### Title: Generate new points with slice sampling > ### Aliases: slice_rectangle > > ### ** Examples > > # Basic usage with default parameters > lrps <- slice_rectangle() > > # More patient sampler for complex posteriors > patient_lrps <- slice_rectangle(enlarge = 1.25) > > > > > cleanEx() > nameEx("special_priors") > ### * special_priors > > flush(stderr()); flush(stdout()) > > ### Name: create_normal_prior > ### Title: Uniform distribution > ### Aliases: create_normal_prior create_uniform_prior > > ### ** Examples > > # Specify a prior with independent marginals > normal <- create_normal_prior( + names = c("beta0", "beta1", "beta2"), + mean = 0, + sd = 5 + ) > uniform <- create_uniform_prior(names = "sd", lower = 0, upper = 5) > composite <- normal + uniform > composite composite prior distribution with 4 dimensions (beta0, beta1, beta2, and sd) > > # Propose a conditional (hierarchical) prior in vectorized form > fn <- function(x) { + n <- nrow(x) + out <- matrix(NA_real_, nrow = n, ncol = 3) + # x[1] follows N(5, 1) + out[, 1] <- stats::qnorm(x[, 1], mean = 5, sd = 1) + # log10(x[2]) follows Uniform(-1, 1) + out[, 2] <- 10^stats::qunif(x[, 2], min = -1, max = 1) + # x[3] follows N(x[1], x[2]) + out[, 3] <- stats::qnorm(x[, 3], mean = out[, 1], sd = out[, 2]) + out + } > > conditional_prior <- create_prior( + vectorized_fn = fn, + names = c("mean", "sd", "x"), + lower = c(-Inf, 0, -Inf) + ) > > # Plot the marginals > sample <- conditional_prior$fn(matrix(runif(1000 * 3), nrow = 1000)) > hist(sample[, 1], main = "mean") > hist(sample[, 2], main = "sd") > hist(sample[, 3], main = "x") > > > > cleanEx() > nameEx("summary.ernest_run") > ### * summary.ernest_run > > flush(stderr()); flush(stdout()) > > ### Name: summary.ernest_run > ### Title: Summarize a nested sampling run > ### Aliases: summary.ernest_run > > ### ** Examples > > data(example_run) > run_sm <- summary(example_run) > run_sm Summary of nested sampling run: ── Run Information ───────────────────────────────────────────────────────────── * No. points: 1000 * Iterations: 9353 * Likelihood evals.: 204731 * Log-evidence: -9.0165 (± 0.0824) * Information: 4.82 * RNG seed: 42 ── Posterior Summary ─────────────────────────────────────────────────────────── # A tibble: 3 × 6 variable mean sd median q15 q85 1 x 0.00123 2.80 -0.00110 -1.88 1.93 2 y -0.00750 2.83 0.000403 -1.98 1.97 3 z -0.0158 2.80 -0.0233 -1.98 1.91 ── Maximum Likelihood Estimate (MLE) ─────────────────────────────────────────── * Log-likelihood: -2.6825 * Original parameters: -0.0425, 0.0561, and -0.006 > run_sm$posterior # A tibble: 3 × 6 variable mean sd median q15 q85 1 x 0.00123 2.80 -0.00110 -1.88 1.93 2 y -0.00750 2.83 0.000403 -1.98 1.97 3 z -0.0158 2.80 -0.0233 -1.98 1.91 > > > > cleanEx() > nameEx("unif_cube") > ### * unif_cube > > flush(stderr()); flush(stdout()) > > ### Name: unif_cube > ### Title: Generate new points from the unconstrained prior distribution > ### Aliases: unif_cube > > ### ** Examples > > data(example_run) > lrps <- unif_cube() > > ernest_sampler(example_run$log_lik_fn, example_run$prior, sampler = lrps) Nested sampling run specification: * No. points: 500 * Sampling method: Uniform unit cube sampling * Prior: uniform prior distribution with 3 dimensions (x, y, and z) > > > > cleanEx() > nameEx("unif_ellipsoid") > ### * unif_ellipsoid > > flush(stderr()); flush(stdout()) > > ### Name: unif_ellipsoid > ### Title: Generate new points from the spanning ellipsoid > ### Aliases: unif_ellipsoid > > ### ** Examples > > data(example_run) > lrps <- unif_ellipsoid(enlarge = 1.25) > > ernest_sampler(example_run$log_lik_fn, example_run$prior, sampler = lrps) Nested sampling run specification: * No. points: 500 * Sampling method: Uniform sampling within a bounding ellipsoid (enlarged by 1.25) * Prior: uniform prior distribution with 3 dimensions (x, y, and z) > > > > cleanEx() > nameEx("visualize.ernest_run") > ### * visualize.ernest_run > > flush(stderr()); flush(stdout()) > > ### Name: visualize.ernest_run > ### Title: Visualize posterior distributions or traces from a nested > ### sampling run > ### Aliases: visualize.ernest_run > > ### ** Examples > > # Load example run > library(ggdist) > data(example_run) > > # Plot posterior densities for all parameters > visualize(example_run, .which = "density") > > > > cleanEx() detaching ‘package:ggdist’ > nameEx("weights.ernest_run") > ### * weights.ernest_run > > flush(stderr()); flush(stdout()) > > ### Name: weights.ernest_run > ### Title: Extract the posterior sample weights from a nested sampling run > ### Aliases: weights.ernest_run > > ### ** Examples > > data(example_run) > weights(example_run) |> head() [1] 4.626832e-59 4.642903e-57 2.136511e-56 3.407974e-56 5.357244e-56 [6] 5.713593e-55 > weights(example_run, log = TRUE) |> head() [1] -134.3206 -129.7120 -128.1856 -127.7186 -127.2663 -124.8993 > > > > ### *