Skip to contents

Predicts gam output. Primarily an internal tool, used in plot_seasonal_gam_panels.R.

Usage

predict_gam(
  model,
  plot_by = "doy",
  across_increment = 1,
  quant_trimming = 0.01,
  verbose = TRUE
)

Arguments

model

A GAM model object from mgcv, or a named list of fitted mgcv models

plot_by

A single string specifying the variable to plot across. Defaults to "doy".

across_increment

A numeric value specifying the increment for the plot_by variable. Defaults to 1.

quant_trimming

A numeric value between 0 and 1 defining quantile-based trimming – this provides a buffer between the outmost observations and the outmost plot predictions. Defaults to 0.01; increase if plot predictions at the edges are misleading.

verbose

Provide context? Logical, defaults to TRUE

Value

A data frame with predictions, confidence intervals, and predictor values.