getPredictiveIntervals: Calculates Bayesian credible (confidence) and predictive...

View source: R/mcmcConfidence.R

getPredictiveIntervalsR Documentation

Calculates Bayesian credible (confidence) and predictive intervals based on parameter sample

Description

Calculates Bayesian credible (confidence) and predictive intervals based on parameter sample

Usage

getPredictiveIntervals(
  parMatrix,
  model,
  numSamples = 1000,
  quantiles = c(0.025, 0.975),
  error = NULL
)

Arguments

parMatrix

matrix of parameter values

model

model / function to calculate predictions. Outcome should be a vector

numSamples

number of samples to be drawn

quantiles

quantiles to calculate

error

function with signature f(mean, par) that generates error expectations from mean model predictions. Par is a vector from the matrix with the parameter samples (full length). f needs to know which of these parameters are parameters of the error function. If supplied, will calculate also predictive intervals additional to credible intervals

Details

If numSamples is greater than the number of rows in parMatrix, or NULL, or FALSE, or less than 1 all samples in parMatrix will be used.

Author(s)

Florian Hartig

See Also

getPredictiveDistribution
getCredibleIntervals


BayesianTools documentation built on Feb. 16, 2023, 8:44 p.m.