Package 'hybridts'

Title: Hybrid Time Series Forecasting Using Error Remodeling Approach
Description: Method and tool for generating hybrid time series forecasts using an error remodeling approach. These forecasting approaches utilize a recursive technique for modeling the linearity of the series using a linear method (e.g., ARIMA, Theta, etc.) and then models (forecasts) the residuals of the linear forecaster using non-linear neural networks (e.g., ANN, ARNN, etc.). The hybrid architectures comprise three steps: firstly, the linear patterns of the series are forecasted which are followed by an error re-modeling step, and finally, the forecasts from both the steps are combined to produce the final output. This method additionally provides the confidence intervals as needed. Ten different models can be implemented using this package. This package generates different types of hybrid error correction models for time series forecasting based on the algorithms by Zhang. (2003), Chakraborty et al. (2019), Chakraborty et al. (2020), Bhattacharyya et al. (2021), Chakraborty et al. (2022), and Bhattacharyya et al. (2022) <doi:10.1016/S0925-2312(01)00702-0> <doi:10.1016/j.physa.2019.121266> <doi:10.1016/j.chaos.2020.109850> <doi:10.1109/IJCNN52387.2021.9533747> <doi:10.1007/978-3-030-72834-2_29> <doi:10.1007/s11071-021-07099-3>.
Authors: Tanujit Chakraborty [aut, cre, cph]
Maintainer: Tanujit Chakraborty <[email protected]>
License: GPL (>= 2)
Version: 0.1.0
Built: 2024-12-17 06:56:59 UTC
Source: CRAN

Help Index


Hybrid ARIMA ANN Forecasting Model

Description

Hybrid ARIMA ANN Forecasting Model

Usage

arima_ann(y, n, PI = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

Value

The forecast of the time series of size n is generated along with the optional output of confidence interval (PI = TRUE) for the forecast.

References

  • Zhang, G. P. (2003). Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing, 50, 159-175.

  • Chakraborty, T., Ghosh, I., Mahajan, T., & Arora, T. (2022). Nowcasting of COVID-19 confirmed cases: Foundations, trends, and challenges. Modeling, Control and Drug Development for COVID-19 Outbreak Prevention, 1023-1064.


Hybrid ARIMA ARNN Forecasting Model

Description

Hybrid ARIMA ARNN Forecasting Model

Usage

arima_arnn(y, n, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

References

  • Chakraborty, T., Chattopadhyay, S., & Ghosh, I. (2019). Forecasting dengue epidemics using a hybrid methodology. Physica A: Statistical Mechanics and its Applications, 527, 121266.

  • Chakraborty, T., Ghosh, I., Mahajan, T., & Arora, T. (2022). Nowcasting of COVID-19 confirmed cases: Foundations, trends, and challenges. Modeling, Control and Drug Development for COVID-19 Outbreak Prevention, 1023-1064.

Examples

arima_arnn(y = datasets::lynx, n = 3)

Hybrid ARIMA WARIMA Forecasting Model

Description

Hybrid ARIMA WARIMA Forecasting Model

Usage

arima_warima(y, n, p = 5, q = 5, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

p

An integer indicating the maximum order of AR process. Default is 5.

q

An integer indicating the maximum order of MA process. Default is 5.

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

References

  • Chakraborty, T., & Ghosh, I. (2020). Real-time forecasts and risk assessment of novel coronavirus (COVID-19) cases: A data-driven analysis. Chaos, Solitons & Fractals, 135, 109850.

  • Chakraborty, T., Ghosh, I., Mahajan, T., & Arora, T. (2022). Nowcasting of COVID-19 confirmed cases: Foundations, trends, and challenges. Modeling, Control and Drug Development for COVID-19 Outbreak Prevention, 1023-1064.

Examples

arima_warima(y = datasets::lynx, n = 3)

Hybrid ETS ARNN Forecasting Model

Description

Hybrid ETS ARNN Forecasting Model

Usage

ets_arnn(y, n, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

Examples

ets_arnn(y = datasets::lynx, n = 3)

Hybrid Random Walk ANN Forecasting Model

Description

Hybrid Random Walk ANN Forecasting Model

Usage

rw_ann(y, n, PI = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

Value

The forecast of the time series of size n is generated along with the optional output of confidence interval (PI = TRUE) for the forecast.


Hybrid Random Walk ARNN Forecasting Model

Description

Hybrid Random Walk ARNN Forecasting Model

Usage

rw_arnn(y, n, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

Examples

rw_arnn(y = datasets::lynx, n = 3)

Summarized score of all the hybrid models implemented in this package

Description

Summarized score of all the hybrid models implemented in this package

Usage

summary_hybridts(train, test)

Arguments

train

A numeric vector or time series object for training the hybrid models

test

A numeric vector or time series object for evaluating the hybrid models

Value

A data frame where the rows represent the out-of-sample scores for each of the hybrid models and the columns represent the RMSE, MASE, and sMAPE scores.


Hybrid Theta ANN Forecasting Model

Description

Hybrid Theta ANN Forecasting Model

Usage

theta_ann(y, n, PI = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

Value

The forecast of the time series of size n is generated along with the optional output of confidence interval (PI = TRUE) for the forecast.


Hybrid Theta ARNN Forecasting Model

Description

Hybrid Theta ARNN Forecasting Model

Usage

theta_arnn(y, n, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

References

  • Bhattacharyya, A., Chakraborty, T., & Rai, S. N. (2022). Stochastic forecasting of COVID-19 daily new cases across countries with a novel hybrid time series model. Nonlinear Dynamics, 1-16.

  • Bhattacharyya, A., Chattopadhyay, S., Pattnaik, M., & Chakraborty, T. (2021, July). Theta Autoregressive Neural Network: A Hybrid Time Series Model for Pandemic Forecasting. In 2021 International Joint Conference on Neural Networks (IJCNN) (pp. 1-8). IEEE.

Examples

theta_arnn(y = datasets::lynx, n = 3)

Hybrid WARIMA ANN Forecasting Model

Description

Hybrid WARIMA ANN Forecasting Model

Usage

warima_ann(y, n, p = 5, q = 5, PI = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

p

An integer indicating the maximum order of AR process. Default is 5.

q

An integer indicating the maximum order of MA process. Default is 5.

PI

A logical flag (default = FALSE) for generating the prediction interval.

Value

The forecast of the time series of size n is generated along with the optional output of confidence interval (PI = TRUE) for the forecast.

References

  • Chakraborty, T., Ghosh, I., Mahajan, T., & Arora, T. (2022). Nowcasting of COVID-19 confirmed cases: Foundations, trends, and challenges. Modeling, Control and Drug Development for COVID-19 Outbreak Prevention, 1023-1064.


Hybrid WARIMA ARNN Forecasting Model

Description

Hybrid WARIMA ARNN Forecasting Model

Usage

warima_arnn(y, n, p = 5, q = 5, PI = FALSE, ret_fit = FALSE)

Arguments

y

A numeric vector or time series

n

An integer specifying the forecast horizon

p

An integer indicating the maximum order of AR process. Default is 5.

q

An integer indicating the maximum order of MA process. Default is 5.

PI

A logical flag (default = FALSE) for generating the prediction interval.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default)

Value

The forecast of the time series of size n is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

References

  • Chakraborty, T., Ghosh, I., Mahajan, T., & Arora, T. (2022). Nowcasting of COVID-19 confirmed cases: Foundations, trends, and challenges. Modeling, Control and Drug Development for COVID-19 Outbreak Prevention, 1023-1064.

Examples

warima_arnn(y = datasets::lynx, n = 3)