
Unnest the predicted values of a given statistic from the simulated data
Source:R/extract_prediction.R
extract_prediction.Rd
Unnest the predicted values of a given statistic from the simulated data
Value
Data frame object containing columns with values of parameters sampled from the posterior, then a column "summary" containing a name of a summary statistic computed for each combination of parameters, column "stat" containing the exact summary statistic computed (useful in case multiple values of the summary statistic computed by a tree-sequence function), and a column "value" containing its value.
Examples
if (FALSE) { # \dontrun{
# read statistics computed from posterior sample simulations
pred <- readRDS(url(paste0(
"https://raw.githubusercontent.com/bodkan/demografr/",
"refs/heads/main/inst/examples/downstream_predX.rds"
)))
# note the columns `diversity`, `divergence`, and `f4`
pred
# extract_prediction() is a convenience function which unpacks the given
# summary statistic in a normal data frame column (here `diversity`)
extract_prediction(pred, "diversity")
} # }