prior_a: Determine Scale Factor Parameter "a" for Laplace Distribution

View source: R/priors.R

prior_aR Documentation

Determine Scale Factor Parameter "a" for Laplace Distribution

Description

The function prior_a determines the parameter a of the laplace distribution that is used in empirical Bayes thresholding approach. Estimation is based on minimizing the avarage of forecast error.

Usage

prior_a(
  x,
  h,
  k,
  lags,
  interval = c(0.1, 5),
  tol = 0.01,
  wtfun = "dwt",
  wtfunlist = list(),
  ...
)

Arguments

x

A vector or a time series containing the data (headline inflation).

h

An integer to set the desired horizon.

k

An integer to determine the number of observations to include in the out-of-sample set.

lags

A data frame generated by the function lags.

interval

A vector containing the end-points of the interval to be searched for the minimum. See: stats::optimize.

tol

The desired accuracy. See: stats::optimize.

wtfun

A wavelet transform function: waveslim::dwt or waveslim::modwt.

wtfunlist

A named list of parameters to pass to the function dwt or modwt.

...

Additional parameters to pass to the function smooth_wavelet.

Value

A numeric vector of length one.

Examples

pq <- lags(2, 1)
ipca <- coreinf_br$ipca
prior_a(
  x = ipca, h = 2, k = 15,
  lags = pq, interval = c(0.1, 3),
  tol = 0.2, wtfun = "dwt",
  wtfunlist = list(
    wf = "haar", n.levels = 4,
    boundary = "reflection"
  ),
  vscale = "independet", threshrule = "mean"
)

nelson16silva/wavcoreinf documentation built on Feb. 17, 2025, 7:10 p.m.