simulate_pffr: Simulate new observations from a 'pffr' model

Description Usage Arguments Value

View source: R/bootstrap_CIs.R

Description

This function can be used to draw a parametric bootstrap sample from a function-on-scalar model fitted with pffr. Per default, new observations are sampled using simulate. If the distribution family used is not supported by simulate, one can also define and pass an own function as sim_fun. One example for this is simulate_gamma, which supports simulation from a Gamma distribution and can be called using sim_fun = "gamma".

Usage

1
simulate_pffr(model, sim_fun = "simulate", y_minValue = NULL)

Arguments

model

Function-on-scalar model fitted with pffr

sim_fun

Function that should be used to draw the parametric bootstrap sample based on model. Default value is 'simulate' which uses the simulate function. For distribution families not supported in simulate one can either use sim_fun = 'gamma' to perform bootstrapping for Gamma models or one can pass the name of its own function to perform the bootstrap. The function should thereby take a pffr model as single argument and return a bootstrapped matrix of y values with one row per observation and one column per functional index (e.g. time point), equivalent to simulate_gamma.

y_minValue

Optional argument. If specified, possible bootstrapped response values smaller than y_minValue are set to y_minValue. This can e.g. be used for Gamma models to prevent estimation problems of models based on the bootstrapped data, caused by response values being too close to zero.

Value

Matrix of reponse values with one row per observation and one column per functional index (e.g. time point).


bauer-alex/FoSIntro documentation built on Feb. 11, 2022, 8:33 a.m.