summary() methods for fits, posteriors, and samples, plus
as.data.frame() for posterior draws so results drop straight into
data-frame workflows (dplyr, ggplot2, ...).
Usage
# S3 method for class 'nsbi_samples'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)
# S3 method for class 'nsbi_samples'
summary(object, probs = c(0.025, 0.25, 0.5, 0.75, 0.975), ...)
# S3 method for class 'nsbi_posterior'
summary(object, n = 1000L, x = NULL, ...)
# S3 method for class 'nsbi_npe'
summary(object, ...)
# S3 method for class 'nsbi_nle'
summary(object, ...)
# S3 method for class 'nsbi_nre'
summary(object, ...)Arguments
- x
Observation to condition on (defaults to the posterior's
x_obs); foras.data.frame(), the samples object.- row.names, optional
Standard
as.data.frame()arguments.- ...
Additional arguments passed to methods.
- object
An
nsbi_samplesmatrix fromsample(), annsbi_posterior, or annsbi_npe,nsbi_nleornsbi_nrefit.- probs
Quantiles to report.
- n
Number of draws used to summarize a posterior.
Value
For samples and posteriors, a data frame with one row per parameter
(mean, sd, and quantiles). For fits, an invisible list of training
metadata. In that list dim_x counts the data dimension the estimator was
trained on, which for an nsbi_nle or nsbi_nre fit is one observation
rather than the whole data set.
