stationary: Build a stationary data series by differencing

View source: R/deepTimeSeries.r

stationaryR Documentation

Build a stationary data series by differencing

Description

Build a stationary data series by differencing

Usage

stationary(
  dataset,
  columns = 2L,
  differences = 1L,
  type = c("simple", "log", "percentage"),
  suffix = "_delta",
  adjust = TRUE
)

Arguments

dataset

A data set, usually a data frame.

columns

The names or indices of the columns to be differentiated to build a stationary series; if NULL, all columns are used.

differences

The number of differences for building stationary series. That's only relevant for the simple type.

type

The type of differencing to be used. Available types are simple, log and percentage.

suffix

The suffix for every newly created column of the stationary series.

adjust

A logical value indicating whether NA values are included to fill up the entire data set in the newly created columns for the stationary series (FALSE) or the entire data set is shorten to the length of the stationary data series (TRUE).

Details

Differencing is a method of transforming a time series. The equations for the different types of differencing are
simple: d(t) = x(t) - x(t-1).
log: d(t) = ln(x(t) / x(t-1)) = ln(x(t)) - ln(x(t-1)).
percentage: d(t) = (x(t) / x(t-1)) - 1.

Value

The data set with newly created columns for the stationary data series.

See Also

invert_differencing.

Other Time Series: diff_log(), diff_percentage(), diffinv_log(), diffinv_percentage(), diffinv_simple(), get_season(), invert_differencing(), lags(), partition(), period()


stschn/deepANN documentation built on June 25, 2024, 7:27 a.m.