intervals: GAM confidence and prediction intervals

predict_intervalsR Documentation

GAM confidence and prediction intervals

Description

Computes CI from posterior, and PI for Tweedie and scat gams.

Usage

predict_intervals(object_fit, new_data, n = 1000, CI = TRUE, PI = TRUE, ...)

Arguments

object_fit

[gam OR bam] The fit to use for predictions.

new_data

[data.frame] The data to predict onto.

n

[numeric] The number of simulations to run for parameters.

CI

[logical] Whether to compute the CI.

PI

[logical] Whether to compute the PI.

...

further arguments passed to the quantile function.

Value

A data.frame with intervals.

Examples

gam1 <- gam(cyl ~ mpg, data=mtcars, family = tw)
predict_intervals(gam1)


pedersen-fisheries-lab/spaspm documentation built on Feb. 16, 2025, 7:39 p.m.