forked from business-science/modeltime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdials-ts_params.R
57 lines (50 loc) · 1.63 KB
/
dials-ts_params.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#' Tuning Parameters for Time Series (ts-class) Models
#'
#' @param values A time-based phrase
#'
#' @details
#'
#' Time series models (e.g. `Arima()` and `ets()`) use [stats::ts()] or [forecast::msts()]
#' to apply seasonality. We can do the same process using the following
#' general time series parameter:
#'
#' - `period`: The periodic nature of the seasonality.
#'
#' It's usually best practice to _not_ tune this parameter, but rather set
#' to obvious values based on the seasonality of the data:
#'
#' - __Daily Seasonality:__ Often used with __hourly data__ (e.g. 24 hourly timestamps per day)
#' - __Weekly Seasonality:__ Often used with __daily data__ (e.g. 7 daily timestamps per week)
#' - __Yearly Seasonalty:__ Often used with __weekly, monthly, and quarterly data__
#' (e.g. 12 monthly observations per year).
#'
#' However, in the event that users want to experiment with period tuning, you
#' can do so with `seasonal_period()`.
#'
#' @examples
#' seasonal_period()
#'
#'
#'
#' @name time_series_params
#' @export
#' @rdname time_series_params
seasonal_period <- function(values = c("none", "daily", "weekly", "yearly")) {
dials::new_qual_param(
type = c("character"),
values = values,
default = "none",
label = c(period = "Period (Seasonal Frequency)"),
finalize = NULL
)
}
# period <- function(range = c(1L, 1L), trans = NULL) {
# dials::new_quant_param(
# type = "integer",
# range = range,
# inclusive = c(TRUE, TRUE),
# trans = trans,
# label = c(period = "Period (Seasonal Frequency)"),
# finalize = NULL
# )
# }