Learn R Programming

deseats (version 1.1.0)

set_options: Specification of Smoothing Options

Description

Set the smoothing specifications for locally weighted regression for identifying the trend and the seasonality in an equidistant time series.

Usage

set_options(
  order_poly = 1,
  season = NA_real_,
  kernel_fun = "epanechnikov",
  bwidth = NA_real_,
  boundary_method = "extend"
)

Value

The function returns an S4 object with the following elements (access via @):

order_poly

identical to the input argument with that name; please see the description of that input argument.

season

identical to the input argument with that name; please see the description of that input argument.

kernel_fun

identical to the input argument with that name; please see the description of that input argument.

bwidth

identical to the input argument with that name; please see the description of that input argument.

boundary_method

identical to the input argument with that name; please see the description of that input argument.

Arguments

order_poly

the order of the local polynomials used for estimating the smooth nonparametric trend; the default is 1.

season

the frequency of observations per time unit, for example per year; set to 12 for monthly data and to 4 for quarterly data and so on; the default is NA_real_, which leads to an automated frequency selection for time series objects in smoothing functions; if the argument is set to NA_real_ and the observations used for smoothing are not formatted as time series objects, the frequency 1 will be used.

kernel_fun

the weighting function to consider; supported are four second-order kernel functions with compact support on \([-1, 1]\); enter "uniform" for the uniform kernel, "epanechnikov" for the Epanechnikov kernel, "bisquare" for the bisquare kernel or "triweight" for the triweight kernel; the default is "epanechnikov".

bwidth

a numeric value that indicates the relative bandwidth to consider in the smoothing process; the default is NA, which then triggers a data-driven selection of an globally optimal bandwidth when the output of this function is passed to a smoothing function.

boundary_method

a single character value; it indicates, what bandwidth method to use at boundary points; for "extend", the default, the smoothing window around boundary points will be extended towards the center of the data; for "shorten", the window width will keep decreasing at boundary points when approaching the very first and the very last observation.

Author

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

Details

An object of class "smoothing_options" is created that contains all required information to conduct a locally weighted regression for decomposing a seasonal time series. The information include the order of the trend polynomials, the frequency of the observed series, the second-order kernel function to use in the weighting process, the (relative) bandwidth to employ, and the boundary method for the bandwidth.