Skip to contents

This function takes a data frame of wisp variables (as columns) and fits a wisp model to it. Statistical analyses and plots are generated from the fitted model.

Usage

wisp(
  count.data,
  variables = list(),
  use.median = FALSE,
  MCMC.settings = list(),
  bootstraps.num = 0,
  converged.resamples.only = TRUE,
  max.fork = 1,
  dim.bounds = c(),
  verbose = TRUE,
  print.plots = TRUE,
  model.settings = list()
)

Arguments

count.data

Data.frame, data to be modeled, with columns for model variables (count, bin, context, species, ran, fixedeffects), or equivalent variables as specified in the variables argument.

variables

List, names of the columns in count.data that correspond to the model variables. The list should contain only (but not necessarily all) named elements: count, bin, context, species, ran, and fixedeffects.

use.median

Logical, if TRUE, the median of the resamples is used as the final parameter estimates; if FALSE, the initial fit by L-BFGS is used.

MCMC.settings

List, settings for the MCMC simulation, including MCMC.burnin, MCMC.steps, MCMC.step.size, MCMC.prior, and MCMC.neighbor.filter. Default values are provided.

bootstraps.num

Integer, number of bootstrap resamples to perform. If 0, only MCMC is run.

converged.resamples.only

Logical, if TRUE, only resamples with a converged fit are used for statistical analysis; if FALSE, all resamples are used. Applies only to bootstraps.

max.fork

Integer, maximum number of parallel processes to use for bootstrapping.

dim.bounds

Numeric vector, block boundaries for plotting in rate-count plots. If empty, the argument is ignored.

verbose

Logical, if TRUE, prints information during the fitting process.

print.plots

Logical, if TRUE, prints plot made during the modeling process.

model.settings

List, settings for the C++ model, including buffer_factor, ctol, max_penalty_at_distance_factor, LROcutoff, LROwindow_factor, rise_threshold_factor, max_evals, rng_seed, and warp_precision. Default values are provided.

Value

List giving the results of the fitted model, including: model.component.list, count.data.summed, fitted.parameters, gamma.disperson, param.names, fix, treatment, grouping.variables, param.idx0, settings, sample.params, sample.params.bs, sample.params.MCMC, diagnostics.bs, diagnostics.MCMC, stats, and plots