cxr_pm_bootstrap: Standard error estimates for model parameters

View source: R/cxr_pm_bootstrap.R

cxr_pm_bootstrapR Documentation

Standard error estimates for model parameters

Description

Computes bootstrap standard errors for a given population dynamics model. This function is provided for completeness, but error calculation is integrated in the function cxr_pm_fit.

Usage

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

Arguments

fitness_model

function returning a single value to minimize, given a set of parameters and a fitness metric

optimization_method

numerical optimization method

data

dataframe with observations in rows and two sets of columns:

  • fitness: fitness metric for the focal individual

  • neighbours: columns with user-defined names with number of neighbours for each group

focal_column

optional integer value giving the position, or name, of the column with neighbours from the same species as the focal one. This is necessary if "alpha_intra" is specified.

covariates

optional matrix with observations in rows and covariates in columns. Each cell is the value of a covariate in a given observation.

init_par

1d vector of initial parameters

lower_bounds

1d vector of lower bounds

upper_bounds

1d vector of upper bounds

fixed_parameters

optional list specifying values of fixed parameters, with components "lambda","alpha_intra","alpha_inter","lambda_cov", and "alpha_cov".

bootstrap_samples

how many bootstrap samples to compute.

Value

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


RadicalCommEcol/cxr documentation built on Oct. 29, 2023, 10:07 p.m.