View source: R/utils-auto-stationarize.R
auto_stationarize | R Documentation |
This function attempts to make a non-stationary time series stationary. This function attempts to make a given time series stationary by applying transformations such as differencing or logarithmic transformation. If the time series is already stationary, it returns the original time series.
auto_stationarize(.time_series)
.time_series |
A time series object to be made stationary. |
If the input time series is non-stationary (determined by the Augmented Dickey-Fuller test), this function will try to make it stationary by applying a series of transformations:
It checks if the time series is already stationary using the Augmented Dickey-Fuller test.
If not stationary, it attempts a logarithmic transformation.
If the logarithmic transformation doesn't work, it applies differencing.
If the time series is already stationary, it returns the original time series. If a transformation is applied to make it stationary, it returns a list with two elements:
stationary_ts: The stationary time series.
ndiffs: The order of differencing applied to make it stationary.
Steven P. Sanderson II, MPH
Other Utility:
calibrate_and_plot()
,
internal_ts_backward_event_tbl()
,
internal_ts_both_event_tbl()
,
internal_ts_forward_event_tbl()
,
model_extraction_helper()
,
ts_get_date_columns()
,
ts_info_tbl()
,
ts_is_date_class()
,
ts_lag_correlation()
,
ts_model_auto_tune()
,
ts_model_compare()
,
ts_model_rank_tbl()
,
ts_model_spec_tune_template()
,
ts_qq_plot()
,
ts_scedacity_scatter_plot()
,
ts_to_tbl()
,
util_difflog_ts()
,
util_doublediff_ts()
,
util_doubledifflog_ts()
,
util_log_ts()
,
util_singlediff_ts()
# Example 1: Using the AirPassengers dataset
auto_stationarize(AirPassengers)
# Example 2: Using the BJsales dataset
auto_stationarize(BJsales)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.