fx_pspline: Get frequency of the climate value with p-spline smoothing

View source: R/fxTWAPLS.R

fx_psplineR Documentation

Get frequency of the climate value with p-spline smoothing

Description

Function to get the frequency of the climate value, which will be used to provide fx correction for WA-PLS and TWA-PLS.

Usage

fx_pspline(x, bin, show_plot = FALSE)

Arguments

x

Numeric vector with the modern climate values.

bin

Binwidth to get the frequency of the modern climate values, the curve will be p-spline smoothed later

show_plot

Boolean flag to show a plot of fx ~ x.

Value

Numeric vector with the frequency of the modern climate values.

See Also

cv.w, cv.pr.w, and sse.sample

Examples

## Not run: 
# Load modern pollen data
modern_pollen <- read.csv("/path/to/modern_pollen.csv")

# Get the frequency of each climate variable fx
fx_pspline_Tmin <- fxTWAPLS::fx_pspline(
  modern_pollen$Tmin,
  bin = 0.02,
  show_plot = TRUE
)
fx_pspline_gdd <- fxTWAPLS::fx_pspline(
  modern_pollen$gdd,
  bin = 20,
  show_plot = TRUE
)
fx_pspline_alpha <- fxTWAPLS::fx_pspline(
  modern_pollen$alpha,
  bin = 0.002,
  show_plot = TRUE
)

## End(Not run)


fxTWAPLS documentation built on Nov. 25, 2022, 5:06 p.m.