Learn R Programming

gmwm (version 2.0.0)

diff_cpp: Lagged Differences in Armadillo

Description

Returns the ith difference of a time series of rth lag.

Usage

diff_cpp(x, lag, differences)

Arguments

x
A vec that is the time series
lag
A unsigned int that indicates the lag
differences
A dif that indicates how many differences should be taken

Value

A vector containing the differenced time series.

Examples

Run this code
x = rnorm(10000, 0, 1)
diff_cpp(x,1,1)

Run the code above in your browser using DataLab