Skip to contents

Run additional model fits with jittered starting values.

Usage

do_jitter(
  x,
  n = 1,
  use_fitted = TRUE,
  return_models = TRUE,
  amount = NULL,
  cores = 1,
  seed,
  ...
)

Arguments

x

MSAassess object returned by fit_MSA()

n

Integer, number of jittered model runs

use_fitted

Logical, whether to jitter from estimated parameters (TRUE) or original starting values (FALSE)

return_models

Logical, whether to return fitted models of the jitter runs

amount

Numeric or NULL, passed to base::jitter()

cores

Integer, number of CPUs for parallel processing

seed

Integer, for replicating the sampling function. Optional.

...

Other arguments to pass to fit_MSA()

Value

If return_models = TRUE, a list (length n) containing MSAassess objects. Otherwise, a data frame of likelihood components made by get_likelihood_components()

Details

The new starting parameters are: pars + amount * runif(n, -1, 1) where pars are either the fitted values or original starting values depending on use_fitted.