Learn R Programming

OncoBayes2 (version 0.9-1)

predictive_interval.blrmfit: Posterior predictive intervals

Description

Posterior predictive intervals of the model.

Usage

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

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.

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.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab