select_trend_filter | R Documentation |
X-11 Selection of Trend Filter
select_trend_filter(x, ...)
## Default S3 method:
select_trend_filter(x, ..., freq)
## S3 method for class 'ts'
select_trend_filter(x, ..., length = 13)
x |
I/C ratio |
... |
further arguments passed to or from other methods. |
freq |
frequency of the time series used to compute the I/C ratio. |
length |
length of the Henderson filter used to compute the I/C ratio. |
The following procedure is used in X-11 to select the length of the trend filter:
Computes the I/C ratio, icr
with an Henderson filter of length 13.
The length depends on the value or icr
:
if icr < 1
then the selected length is 9 for monthly data and 5 otherwise;
if 1 \leq icr < 3.5
then the selected length is freq + 1
where freq
is the frequency of data (12 for monthly data, 4 for quarterly data...).
if icr \geq 3.5
then the selected length is 23 for monthly data and 7 otherwise.
# example code
x <- retailsa$AllOtherGenMerchandiseStores
sc <- henderson(x, length = 13, musgrave = FALSE)
icr <- ic_ratio(x, sc)
select_trend_filter(icr, freq = 12)
# Because Henderson filter is used, this is equivalent to:
select_trend_filter(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.