ForwardDifference: Forward Difference

Description Usage Arguments Value

Description

Given a numeric series x, compute its n-offset forward difference y, such that y[i] = x[i+n] - x[i].

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ForwardDifference(x, ...)

## S3 method for class 'numeric'
ForwardDifference(x, n = 1, order = 1, samplingRate = n,
  ...)

## S3 method for class 'data.frame'
ForwardDifference(x, n = 1, order = 1, ...)

## S3 method for class 'list'
ForwardDifference(x, n = 1, order = 1, ...)

## S3 method for class 'list'
CentralDifference(x, n = 1, order = 1, ...)

Arguments

x

A numeric vector or a data frame of numeric vectors.

...

Placeholder for future methods.

n

An atomic numeric, the number of samples forward from the current sample used in the forward difference. Default is 1.

order

An atomic numeric, the number of times the forward-difference operator is applied to x. Default is 1.

samplingRate

An atomic numeric, the sampling rate of x, in hertz. The raw forward difference of x is divided by the sampling rate so that the forward difference can be interepreted as an estimate of the derivative of x. Default is n, which yields the raw forward difference.

Value

The forward difference of x if x is numeric, or of each column of x if x is a data frame.


patrickreidy/ag501 documentation built on May 30, 2019, 10:01 p.m.