This function finds the number of observations in the window over which size is to be controlled.
Usage
ps_tb(n, freq = c("monthly", "quarterly", "annual", "weekly"), size = 2)Value
A single integer, the length of the training window in observations,
suitable for the r_star argument of monitor.
References
Phillips, P. C., & Shi, S. (2020). Real time monitoring of asset markets: Bubbles and crises. In Handbook of Statistics (Vol. 42, pp. 61-80). Elsevier.
Shi, S., Hurn, S., Phillips, P.C.B., 2018. Causal change detection in possibly integrated systems: Revisiting the money-income relationship.
Examples
# Training window that controls size over a 2-year span of monthly data
tb <- ps_tb(100, freq = "monthly", size = 2)
tb
#> [1] 42
# \donttest{
# Use it directly as the training window of monitor()
monitor(sim_data, r_star = tb, boundary = "kurozumi")
#>
#> ── monitor (T* = 42 / 100, minw = 19, sig_lvl = 95%, boundary = kurozumi) ──────
#>
#> series boundary alarm alarm_date
#> psy1 1.038 50 50
#> psy2 1.038 NA <NA>
#> evans 1.038 NA <NA>
#> div 1.038 NA <NA>
#> blan 1.038 NA <NA>
#>
# }
