draws-OncoBayes2: Transform 'blrmfit' or 'blrm_trial' to 'draws' objects

draws-OncoBayes2R Documentation

Transform blrmfit or blrm_trial to draws objects

Description

[Experimental]

Transform a blrmfit or blrm_trial object to a format supported by the posterior package.

Usage

## S3 method for class 'blrmfit'
as_draws(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrmfit'
as_draws_matrix(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrmfit'
as_draws_array(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrmfit'
as_draws_df(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrmfit'
as_draws_list(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrmfit'
as_draws_rvars(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws_matrix(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws_array(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws_df(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws_list(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

## S3 method for class 'blrm_trial'
as_draws_rvars(x, variable = NULL, regex = FALSE, inc_warmup = FALSE, ...)

Arguments

x

A blrmfit or blrm_trial object.

variable

A character vector providing the variables to extract. By default, all variables are extracted.

regex

Logical; Should variable be treated as a (vector of) regular expressions? Any variable in x matching at least one of the regular expressions will be selected. Defaults to FALSE.

inc_warmup

Should warmup draws be included? Defaults to FALSE.

...

Arguments passed to individual methods (if applicable).

Details

To subset iterations, chains, or draws, use the subset_draws method after transforming the input object to a draws object.

The function is experimental as the set of exported posterior variables are subject to updates.

See Also

draws subset_draws

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
)

# fit an example model. See documentation for "combo2" example
example_model("combo2")

post <- as_draws(blrmfit)

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


OncoBayes2 documentation built on April 11, 2025, 5:42 p.m.