gain,deseats-method {deseats}R Documentation

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 signature 'deseats'
gain(object, lambda = seq(0, 0.5, 1e-04), ...)

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.

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.

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.

Author(s)

Examples


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")
 


[Package deseats version 1.1.0 Index]