step_fft_pgram: step_fft_pgram

View source: R/api_recipes.R

step_fft_pgramR Documentation

step_fft_pgram

Description

Periodgrams and cross-periodograms using a method similar to stats::spec.pgram.

Usage

step_fft_pgram(
  .rec,
  terms,
  spans = 3,
  detrend = TRUE,
  demean = TRUE,
  lst = TRUE,
  taper = 0.1,
  pad_fft = TRUE,
  time_step = 1,
  role = "predictor",
  ...
)

Arguments

.rec

the R6 recipe object.

terms

the unquoted names of the variables to use or a selector function. terms replaces the '...' of the recipes package but requires variables to be included within 'c()'. For example to include variables x and y you would write 'c(x,y)' in the hydrorecipes package.

spans

vector of odd integers giving the widths of modified Daniell smoothers to be used to smooth the periodogram.

detrend

logical. If TRUE, remove a linear trend from the series. This will also remove the mean.

demean

logical. If TRUE, subtract the mean of the series.

lst

logical return a list?

taper

specifies the proportion of data to taper. A split cosine bell taper is applied to this proportion of the data at the beginning and end of the series.

pad_fft

logical Zero pad the list for faster FFT calculation?

role

character - the name of the role

...

additional arguments

Value

an updated recipe

Examples

formula <- as.formula(y~.)

dat <- data.frame(x = rnorm(200),
                  y = rnorm(200))

frec = recipe(formula = formula, data = dat) |>
  step_fft_pgram(c(x,y))


jkennel/hydrorecipes documentation built on Dec. 24, 2024, 5:38 p.m.