Learn R Programming

deseats (version 1.1.0)

gain,deseats-method: Obtain gain function values for DeSeaTS Trend and Detrend Filters

Description

Obtain gain function values for DeSeaTS Trend and Detrend Filters

Usage

# S4 method for deseats
gain(object, lambda = seq(0, 0.5, 1e-04), ...)

Value

A list is returned. Each element represents gain function values at the specified frequencies lambda for the filter defined through the element name.

gain_trend

gain function values for the trend filter.

gain_detrend

gain function values for the detrending filter.

gain_season

gain function values for the seasonality filter.

gain_deseason

gain function values for the seasonal adjustment filter.

gain_comb

gain function values for the trend + seasonality filter.

gain_decomb

gain function values for the detrending + seasonal adjustment filter.

Arguments

object

an object of class "deseats".

lambda

a numeric vector with the frequencies at which to get the gain function values.

...

no current purpose for this ellipsis.

Author

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

Details

The various filters obtained via deseats (represented by the returned weighting systems) have a representation in the frequency domain. Using this method, those gain function values can be easily obtained.

Examples

Run this code
# \donttest{
xt <- log(EXPENDITURES)
est <- deseats(xt)

lambda <- seq(0, 0.5, 0.01)
gain_values <- gain(est, lambda = lambda)
m <- length(gain_values$gain_trend[, 1])
k <- (m - 1) / 2
colF <- colorRampPalette(c("deepskyblue4", "deepskyblue"))
cols <- colF(m)

matplot(lambda, t(gain_values$gain_decomb[1:(k + 1), ]), 
 type = paste0(rep("l", k + 1), collapse = ""),
 col = cols, lty = rep(1, k + 1))
title("Gain functions of the combined detrend and deseasonalization filters")

matplot(lambda, t(gain_values$gain_trend[1:(k + 1), ]), 
 type = paste0(rep("l", k + 1), collapse = ""),
 col = cols, lty = rep(1, k + 1))
title("Gain functions of the trend filters")

matplot(lambda, t(gain_values$gain_deseason[1:(k + 1), ]), 
 type = paste0(rep("l", k + 1), collapse = ""),
 col = cols, lty = rep(1, k + 1))
title("Gain functions of the seasonal adjustment filters")
# } 

Run the code above in your browser using DataLab