Learn R Programming

fChange (version 2.1.0)

diff.dfts: Difference dfts

Description

Difference the functional data at some lag and iteration. For the \(\ell\)'th difference at lag \(m\), the differenced series is defined as \( Y_i(t) = (1-B^m)^{\ell} X_i(t) \) where \(B\) is the backshift operator.

Usage

# S3 method for dfts
diff(x, lag = 1L, differences = 1L, ...)

Value

A dfts object with the differenced values.

Arguments

x

A dfts object or data which can be automatically converted to that format. See dfts().

lag

An integer indicating which lag to use.

differences

An integer indicating the order of the difference.

...

Further arguments to be passed to methods.

Examples

Run this code
result <- diff(electricity, lag = 1)
result1 <- diff(electricity, differences = 2)

Run the code above in your browser using DataLab