Skip to contents

Calculates means, standard deviations, and quantiles from stored draws, pooling chains. No new observations or latent effects are simulated.

Usage

# S3 method for class 'magCompPrediction'
summary(object, probs = c(0.025, 0.5, 0.975), ...)

Arguments

object

Stored draws returned by fitted(), predict(), or standSummary() with summary = "samples".

probs

Nonempty numeric vector of quantile probabilities strictly between zero and one. Defaults give the median and a 95% interval.

...

Currently unused.

Value

A data frame with one row per unit, quantity, and category. Its class is magCompPredictionSummary. The identifying columns are unit, quantity, and category; magnitude uses category "total". Columns mean, sd, and the requested quantiles (for example, q2_5, q50, and q97_5) summarize each row; n_draws counts the draws used. Rows follow the requested quantity order, then category order, with units in their original order within each category. The metadata attribute preserves the source object's metadata, including measurement units, target, and conditioning information. The probs attribute records the summary's quantile probabilities.

Details

Expected-target intervals describe uncertainty in conditional means. Observation-target intervals also include variation from the observation model. Proportions from observation predictions or stand aggregation are undefined at zero totals: their summaries use positive-total draws only. If none remain, the summary statistics are NA and n_draws is zero. Counts, totals, densities, and magnitudes retain zero-valued draws. Standard deviations are NA when fewer than two draws contribute.

Objects containing only means or quantiles cannot supply these summaries. Retain draws with summary = "samples" in the original call. For stand results, units are stand IDs and quantities are density, total, or proportion; the same calculations apply. This method summarizes each unit and category separately; use standSummary() or aggregate stored draws before summarizing to obtain area-level intervals.

See also

Examples

if (FALSE) { # \dontrun{
draws <- predict(fit, newdata, summary = "samples")
summary(draws)
summary(draws, probs = c(0.05, 0.5, 0.95))

replicates <- fitted(fit, target = "observation", summary = "samples")
summary(replicates)
} # }