Learn R Programming

predtoolsTS (version 0.1.1)

prep.detrend.differencing: Detrend with differencing method

Description

Performs differencing with lag=1.

Usage

prep.detrend.differencing(tserie, nd = NULL)

Arguments

tserie

a ts object

nd

number of differences to apply. As default its value is NULL; in this case, the function will perform an automatic estimation of nd.

Value

A list is returned containing:

tserie

Transformed ts object.

nd

Number of differencies applied.

firstvalues

Lost values after differencing.

Details

If no number of differences is specified, the function will make an estimation of the number of differences needed based on unit root test provided by forecast::ndiffs

Examples

Run this code
# NOT RUN {
prep.detrend.differencing(AirPassengers)
prep.detrend.differencing(AirPassengers,nd=2)
# }

Run the code above in your browser using DataLab