predictive_interval.blrmfit: Posterior predictive intervals

View source: R/predictive_interval.R

predictive_interval.blrmfitR Documentation

Posterior predictive intervals

Description

Posterior predictive intervals of the model.

Usage

## S3 method for class 'blrmfit'
predictive_interval(object, prob = 0.95, newdata, ...)

Arguments

object

fitted model object

prob

central probability mass to report, i.e. the quantiles 0.5-prob/2 and 0.5+prob/2 are displayed. Multiple central widths can be specified.

newdata

optional data frame specifying for what to predict; if missing, then the data of the input model object is used

...

not used in this function

Details

Reports for each row of the input data set the predictive interval according to the fitted model.

Value

Matrix with as many rows as the input data set and two columns which contain the lower and upper quantile corresponding to the central probability mass prob for the number of responses of the predictive distribution.

Examples

## Setting up dummy sampling for fast execution of example
## Please use 4 chains and 100x more warmup & iter in practice
.user_mc_options <- options(OncoBayes2.MC.warmup=10, OncoBayes2.MC.iter=20, OncoBayes2.MC.chains=1,
                            OncoBayes2.MC.save_warmup=FALSE)

example_model("single_agent", silent=TRUE)

predictive_interval(blrmfit)

## Recover user set sampling defaults
options(.user_mc_options)


OncoBayes2 documentation built on July 26, 2023, 5:30 p.m.