mobster_bootstrap: Bootstrap a MOBSTER fit.

View source: R/mobster_bootstrap.R

mobster_bootstrapR Documentation

Bootstrap a MOBSTER fit.

Description

Parametric and non-parametric implementation of bootstrap estimates for MOBSTER fits. This computation is parallel and uses ?easypar.

Usage

mobster_bootstrap(
  x,
  n.resamples = 100,
  bootstrap = "nonparametric",
  cores.ratio = 0.8,
  cache = NULL,
  save_data = NULL,
  ...
)

Arguments

x

An object of class "dbpmm".

n.resamples

Number of boostrap resamples.

bootstrap

Type of boostrap: "parametric" or "nonparametric"

cores.ratio

Ratio of cores to use for the parallel; see ?easypar.

cache

Cache for the computation; see ?easypar.

...

fit parameters for mobster_fit

Value

Data from the fits, resamples and a plottable figure.

Examples

# Random small dataset
dataset = random_dataset(N = 200, seed = 123, Beta_variance_scaling = 100)
x = mobster_fit(dataset$data, auto_setup = 'FAST')

# Just 5 resamples of a nonparametric bootstrap run, disabling the parallel engine
options(easypar.parallel = FALSE)
boot_results = mobster_bootstrap(x$best, n.resamples = 5, auto_setup = 'FAST')

# The resample data is available in a list
print(boot_results$resamples[[1]])

# The best fits are returned
print(boot_results$fits)

caravagnalab/mobster documentation built on March 25, 2023, 3:40 p.m.