fd: Estimate fractional differencing parameter and/or...

View source: R/fd.R

fdR Documentation

Estimate fractional differencing parameter and/or differenciate series for a given d-value

Description

This is a wrapper function for the hurstSpec-function as well as the fracdiff-package for internal use as part of the arfimaMLM function. The function estimates the fractional differencing parameter d of a series x and returns the fractionally differenced series. Alternatively, the differencing parameter can be estimated externally and included as a numeric argument in dval. In this case, the function returns the fractionally differenced series without estimating the differencing parameter itself.

Usage

fd(x, dval = "ML", ...)

## S3 method for class 'character'
fd(x, dval = "ML", ...)

## S3 method for class 'numeric'
fd(x, dval, ...)

Arguments

x

Numeric vector or time series to be fractionally differenced.

dval

Call for a specific estimation method for the fractional differencing parameter in the hurstSpec-function ("Hurst") or the fracdiff-package ("ML", "GPH", or "Sperio"). Default is "ML". Alternatively, dval can be a numeric argument that will be directly passed to diffseries to calculate the fractionally differenced series according to the differencing parameter specified in dval. If a value of 0 is specified, the function will simply return the original series x.

...

Further arguments passed to hurstSpec, fracdiff, fdGPH, fdSperio, or diffseries.

Value

series

Fractionally differenciated series.

estimator

Method used to estimate differencing parameter ("Hurst", "ML", "GPH", or "Sperio")), prompts "external" if a differencing parameter was provided as numeric argument for dval.

value

Estimated differencing parameter, returns the dval input if a numeric argument was provided for dval.

Author(s)

Patrick Kraft

References

See those in hurstSpec, fracdiff, fdGPH, fdSperio, and diffseries.

See Also

hurstSpec, fracdiff, fdGPH, fdSperio, diffseries

Examples

require(fractal)
require(fracdiff)

set.seed(123)
series=fracdiff.sim(100, d=0.4, mu=10)$series

## S3 method for class 'character'
# estimates fractional differencing parameter d
# and differenciates series accordingly
series.fd1<-fd(series)
series.fd2<-fd(series, dval="ML")
series.fd3<-fd(series, dval="GPH")
series.fd4<-fd(series, dval="Sperio")

## S3 method for class 'numeric'
# differenciates series according to 
# externally provided differencing parameter
series.fd5<-fd(series, dval=0.4)

pwkraft/ArfimaMLM documentation built on March 29, 2022, 3:20 p.m.