Description Usage Arguments Details Value Examples
View source: R/HELPER_get_periodogram.R
get_periodogram
is a function to get an object of class "spec" for a
univariate time series.
1 | get_periodogram(ts_object, type = c("additive", "multiplicative"))
|
ts_object |
A univariate time series. |
type |
A character string indicating whether an additive or multiplicative seasonal component should be used to create the periodogram. |
The function will, for a univariate time series, compute the periodogram and returns an object of class "spec". Components of "spec" is shown in names(sp). In this package, components of "freq" and "spec" is utilised.
sp: an object of class "spec". We mainly use freq and spec components of sp. "freq" is Vector of frequencies at which the spectral density is estimated. "spec" is Vector of estimates of the periodogram at frequencies corresponding to freq.
1 2 3 4 5 6 7 8 9 10 11 | ts_object <- tstools::initialize_ts_forecast_data(
data = dummy_gasprice,
date_col = "year_month",
col_of_interest = "gasprice",
group_cols = c("state", "oil_company"),
xreg_cols = c("spotprice", "gemprice")
) %>%
dplyr::filter(grouping == "state = New York & oil_company = CompanyB") %>%
dplyr::select(period, col_of_interest, grouping) %>%
tstools::transform_data_to_ts_object(seasonal_periods = 1)
get_periodogram(ts_object)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.