cxr_er_bootstrap: standard error estimates for effect and response parameters

View source: R/cxr_er_bootstrap.R

cxr_er_bootstrapR Documentation

standard error estimates for effect and response parameters

Description

Computes bootstrap standard errors for a given effect/response function. This function is provided for completeness, but error calculation is integrated in the function cxr_er_fit.

Usage

cxr_er_bootstrap(
  fitness_model,
  optimization_method,
  data,
  covariates,
  init_par,
  lower_bounds,
  upper_bounds,
  fixed_parameters,
  bootstrap_samples
)

Arguments

fitness_model

effect/response function, see cxr_er_fit

optimization_method

numerical optimization method.

data

either a list of dataframes or a single dataframe. if 'data' is a list, each element is a dataframe with the following columns:

  • fitness: fitness metric for each observation

  • neighbours: named columns giving the number of neighbours of each column the names of the list elements are taken to be the names of the focal species.

If 'data' is a dataframe, it also needs a 'focal' column. Regardless of the data structure, all focal species need to have the same number of observations (i.e. same number of rows), and the set of neighbour species needs to be the same as the set of focal species, so that the neighbours columns correspond to the names of the list elements or, if 'data' is a dataframe, to the values of the 'focal' column. Future versions will relax this requirement.

covariates

a data structure equivalent to 'data', in which each column are the values of a covariate.

init_par

initial values for parameters

lower_bounds

optional list with single values for "lambda", "effect","response", and optionally "lambda_cov", "effect_cov", "response_cov".

upper_bounds

optional list with single values for "lambda", "effect","response", and optionally "lambda_cov", "effect_cov", "response_cov".

fixed_parameters

list with values for fixed parameters, or NULL.

bootstrap_samples

number of bootstrap samples for error calculation. Defaults to 0, i.e. no error is calculated.

Value

1d vector, the standard error of each parameter in init_par


cxr documentation built on Oct. 27, 2023, 1:08 a.m.