Learn R Programming

deseats (version 1.1.0)

fitted,hfilter-method: Fitted Components of the Hamilton Filter

Description

Obtain either fitted values or residuals from a fitted Hamilton filter.

Usage

# S4 method for hfilter
fitted(object, ...)

# S4 method for hfilter residuals(object, ...)

Value

A time series object of class "ts" is returned.

Arguments

object

an object of class "hfilter", i.e. generated by a call to hamilton_filter.

...

currently without further use; implemented for compatibility.

Author

  • Dominik Schulz (Research Assistant) (Department of Economics, Paderborn University),
    Author and Package Creator

Details

Obtain the fitted and the residual values from the result of a fitted Hamilton filter. The name of the method indicates, what is returned.

Examples

Run this code
est <- hamilton_filter(log(EXPENDITURES))
residuals(est)
fitted(est)

Run the code above in your browser using DataLab