Skip to contents

Fits a model whose memory p_n grows with the sample size, studentises the chosen statistic, clips everything below the threshold tau_n, and reports the last surviving lag (Fine & Hwang 1979).

Usage

fh_order(
  x,
  statistic = "pacf",
  threshold = "bic",
  c = 1.5,
  alpha = 0.05,
  memory = NULL
)

Arguments

x

A numeric vector (a stationary series).

statistic

One of "pacf" (AR, default), "acf_bartlett" (MA), "inverse_pacf" (MA), "jirak_band" (AR, exact Jirak-2012 studentisation), "pacf_robust" and "acf_robust" (experimental, 25% breakdown against additive outliers), "long_ar_yw", "long_ar_ols", "acf".

threshold

One of "bic" (default, sqrt(c log n)), "lil", "maxk", "gumbel" (level alpha), "fixed" (value c).

c

Threshold constant (default 1.5).

alpha

Level for the "gumbel" threshold (default 0.05).

memory

Growing memory p_n; NULL uses the statistic's default (ceiling(2 log n)).

Value

A list with order, p_n, tau, the raw values and the studentized path.

Examples

set.seed(1)
x <- arima.sim(list(ar = c(1.2, -0.6)), 400)
fh_order(x)$order
#> [1] 2