Skip to contents

Calls the sightability API to fit a model and return everything from sight_fit_summary() plus raw intermediate pipeline objects useful for debugging. For classical models this includes prepared observations with detection probabilities, beta coefficients, design matrix metadata, and the variance-covariance matrix. For JAGS models, returns prepared observations without detection fields.

Usage

sight_fit_diagnostics(
  species,
  spatial_focus,
  bio_year,
  analysis_unit,
  survey_type,
  model,
  ...
)

sight_fit_diagnostics_id(
  species_id,
  spatial_focus,
  bio_year,
  analysis_unit_id,
  survey_type_id,
  model_id,
  dry_run = FALSE,
  ...
)

Arguments

species

Character. Species name.

spatial_focus

Character. One of "DAU", "GMU", or "SubUnit".

bio_year

Integer. Biological year.

analysis_unit

Character. Analysis unit name.

survey_type

Character. Survey type name.

model

Character. Model name.

...

Additional arguments passed to the underlying spdgt.auth function (e.g., verbosity, timeout).

species_id

Integer. Species identifier.

analysis_unit_id

Integer. Analysis unit identifier.

survey_type_id

Integer. Survey type identifier.

model_id

Integer. Sightability model identifier.

dry_run

If TRUE, print the HTTP request without sending it and return the request object invisibly. Useful for debugging.

Value

List containing all sight_fit_summary() fields plus:

  • observations: Full prepared data tibble (with theta, xie, and covar_beta for classical models)

  • betas: Tibble of beta coefficients (NULL for JAGS models)

  • design_matrix: List with nrow, ncol, colnames (NULL for JAGS models)

  • vcov: Variance-covariance matrix (NULL for JAGS models)

See also

Examples

if (FALSE) { # \dontrun{
# Using names
sight_fit_diagnostics(
  species = "Mule Deer",
  spatial_focus = "DAU",
  bio_year = 2024,
  analysis_unit = "North Converse 755",
  survey_type = "Sightability",
  model = "Mule Deer"
)

# Using IDs
sight_fit_diagnostics_id(
  species_id = 1,
  spatial_focus = "DAU",
  bio_year = 2024,
  analysis_unit_id = 272,
  survey_type_id = 3,
  model_id = 1
)
} # }