Skip to contents

This function uses a GAM to smooth a numeric vector

Usage

GAM_smoothing(values, years = 1:length(values), plot = FALSE, ...)

Arguments

values

A numeric vector that will be smoothed

years

Optional, the years that value corresponds to as a numeric vector.

plot

If TRUE a plot is generated showing the smoothed spline.

...

other arguements passed to mgcv::gam

Value

The smoothed/predicted values are returned as well as the model object used for making predictions.