# Forecasting Regional Tourism Demand in Morocco from Traditional and AI-Based Methods to Ensemble Modeling

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Data and Preprocessing

#### 2.2. Metrics for Accuracy Measures

#### 2.3. Methodology

#### 2.3.1. Support Vector Regression (SVR)

#### 2.3.2. Long Short-Term Memory (LSTM)

#### 2.3.3. eXtreme Gradient Boosting (XGBoost)

#### 2.3.4. Univariate Linear Regression

#### 2.3.5. Autoregressive (AR) Model

#### 2.3.6. Autoregressive Integrated Moving Averages (ARIMA) Model

#### 2.3.7. Robust Forecasting Using Ensemble Learning

## 3. Results

#### 3.1. Forecasting Results and Findings of the First-Level Models

#### 3.2. Results and Findings of the Second-Level Models

## 4. Discussion

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Appendix A

Model | Parameters |
---|---|

LSTM | optimizer = ‘adam’, loss = ‘mean_squared_error’, batch_size = 1, epochs = 300 |

XGBoost | objective = ‘reg:squarederror’, n_estimators = 1000 |

SVR | Kernel = “linear”, C = 1, gamma = “auto”, epsilon = 0.1 |

ARIMA | order = ([1,2,3,4],2,0), trend = ‘n’ |

AR | lags = [1,2,3],trend = “n” |

Ensemble learning | algo = LassoCV(positive = True) |

## References

- Song, H.; Li, G. Tourism demand modelling and forecasting—A review of recent research. Tour. Manag.
**2008**, 29, 203–220. [Google Scholar] [CrossRef] [Green Version] - Sun, S.; Wei, Y.; Tsui, K.-L.; Wang, S. Forecasting tourist arrivals with machine learning and internet search index. Tour. Manag.
**2019**, 70, 1–10. [Google Scholar] [CrossRef] - Zhou-Grundy, Y.; Turner, L.W. The Challenge of Regional Tourism Demand Forecasting: The Case of China. J. Travel Res.
**2014**, 53, 747–759. [Google Scholar] [CrossRef] - Goh, C.; Law, R. Modeling and forecasting tourism demand for arrivals with stochastic nonstationary seasonality and intervention. Tour. Manag.
**2002**, 23, 499–510. [Google Scholar] [CrossRef] - Gunter, U. Improving Hotel Room Demand Forecasts for Vienna across Hotel Classes and Forecast Horizons: Single Models and Combination Techniques Based on Encompassing Tests. Forecast
**2021**, 3, 884–919. [Google Scholar] [CrossRef] - Witt, S.F.; Song, H.; Wanhill, S. Forecasting Tourism-Generated Employment: The Case of Denmark. Tour. Econ.
**2004**, 10, 167–176. [Google Scholar] [CrossRef] - Sheldon, P.J. Forecasting Tourism: Expenditures versus Arrivals. J. Travel Res.
**1993**, 32, 13–20. [Google Scholar] [CrossRef] - Constantino, H.; Fernandes, P.; Teixeira, J. Tourism demand modelling and forecasting with artificial neural network models: The Mozambique case study. Tékhne
**2016**, 14, 113–124. [Google Scholar] [CrossRef] - Claveria, O.; Torra, S. Forecasting tourism demand to Catalonia: Neural networks vs. time series models. Econ. Model.
**2014**, 36, 220–228. [Google Scholar] [CrossRef] [Green Version] - Soh, A.-N.; Puah, C.-H.; Arip, M.A. Forecasting Tourism Demand with Composite Indicator Approach for Fiji. Bus. Econ. Res.
**2019**, 9, 12–22. [Google Scholar] [CrossRef] [Green Version] - Ann-Ni, S.; Chin-Hong, P.; Affendy, A.M. Tourism Forecasting and Tackling Fluctuating Patterns: A Composite Leading Indicator Approach. Stud. Bus. Econ.
**2020**, 15, 192–204. [Google Scholar] [CrossRef] - Dupeyras, A.; Maccallum, N. Indicators for Measuring Competitiveness in Tourism; OECD Tourism Papers; OECD: Paris, France, 2013. [Google Scholar] [CrossRef]
- Petrevska, B. Predicting tourism demand by A.R.I.M.A. models. Econ. Res.-Ekon. Istraž.
**2017**, 30, 939–950. [Google Scholar] [CrossRef] - Baldigara, T.; Mamula, M. Modelling international tourism demand using seasonal ARIMA models. Tour. Hosp. Manag.
**2015**, 21, 19–31. [Google Scholar] [CrossRef] - Ismail, E.A.A. Forecasting the number of Arab and foreign tourists in Egypt using ARIMA models. Int. J. Syst. Assur. Eng. Manag.
**2020**, 11, 450–454. [Google Scholar] [CrossRef] - Zhou, T.; Bonham, C.; Gangnes, B. Modeling the Supply and Demand for Tourism: A Fully Identified VECM Approach; Department of Economics Working Papers; University of Hawaii: Honolulu, HI, USA, 2007; Volume 200717. [Google Scholar]
- Song, H.; Qiu, R.T.; Park, J. A review of research on tourism demand forecasting: Launching the Annals of Tourism Research Curated Collection on tourism demand forecasting. Ann. Tour. Res.
**2019**, 75, 338–362. [Google Scholar] [CrossRef] - Goh, C.; Law, R. The Methodological Progress of Tourism Demand Forecasting: A Review of Related Literature. J. Travel Tour. Mark.
**2011**, 28, 296–317. [Google Scholar] [CrossRef] - Peng, B.; Song, H.; Crouch, G.I. A meta-analysis of international tourism demand forecasting and implications for practice. Tour. Manag.
**2014**, 45, 181–193. [Google Scholar] [CrossRef] - Chen, K.-Y. Combining linear and nonlinear model in forecasting tourism demand. Expert Syst. Appl.
**2011**, 38, 10368–10376. [Google Scholar] [CrossRef] - E Nor, M.; Nurul, A.I.M.; Rusiman, M.S. A Hybrid Approach on Tourism Demand Forecasting. J. Phys. Conf. Ser.
**2018**, 995, 012034. [Google Scholar] [CrossRef] - Koutras, A.; Panagopoulos, A.; Nikas, I.A. Forecasting tourism demand using linear and nonlinear prediction models. Acad. Tur.-Tour. Innov. J.
**2017**, 9, 85–98. [Google Scholar] - Lia, H.; Hu, M.; Lid, G. Forecasting tourism demand with multisource big data. Ann. Tour. Res.
**2020**, 83, 102912. [Google Scholar] [CrossRef] - Guizzardi, A.; Stacchini, A. Real-time forecasting regional tourism with business sentiment surveys. Tour. Manag.
**2015**, 47, 213–223. [Google Scholar] [CrossRef] - Laaroussi, H.; Guerouate, F.; Sbihi, M. Deep Learning Framework for Forecasting Tourism Demand. In Proceedings of the 2020 IEEE International Conference on Technology Management, Operations and Decisions (ICTMOD), Marrakech, Morocco, 24–27 November 2020; pp. 1–4. [Google Scholar] [CrossRef]
- Nguyen, L.Q.; Fernandes, P.O.; Teixeira, J.P. Analyzing and Forecasting Tourism Demand in Vietnam with Artificial Neural Networks. Forecasting
**2021**, 4, 36–50. [Google Scholar] [CrossRef] - Khashei, M.; Bijari, M. A novel hybridization of artificial neural networks and ARIMA models for time series forecasting. Appl. Soft Comput.
**2011**, 11, 2664–2675. [Google Scholar] [CrossRef] - Vapnik, V.N. The Nature of Statistical Learning Theory; Springer: New York, NY, USA, 1997. [Google Scholar] [CrossRef]
- Schölkopf, B.; Smola, A.J.; Bach, F. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond; MIT Press: Cambridge, MA, USA, 2002. [Google Scholar]
- Claveria, O.; Torra, S. Modelling Tourism Demand To Spain With Machine Learning Techniques. THE Impact of Forecast Horizon on Model Selection. arXiv
**2018**, arXiv:1805.00878. [Google Scholar] - Chen, K.-Y.; Wang, C.-H. Support vector regression with genetic algorithms in forecasting tourism demand. Tour. Manag.
**2007**, 28, 215–226. [Google Scholar] [CrossRef] - Kamel, N.; Atiya, A.F.; el Gayar, N.; El-Shishiny, H. Tourism demand forecasting using machine learning methods. ICGST Int. J. Artif. Intell. Mach. Learn.
**2008**, 8, 1–7. [Google Scholar] - Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput.
**1997**, 9, 1735–1780. [Google Scholar] [CrossRef] - Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016. [Google Scholar] [CrossRef] [Green Version]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Smith, T.G. Pmdarima: ARIMA Estimators for Python. 2017. Available online: http://www.alkaline-ml.com/pmdarima (accessed on 4 February 2022).
- Wolpert, D.H. Stacked generalization. Neural Netw.
**1992**, 5, 241–259. [Google Scholar] [CrossRef] - Brownlee, J. Deep Learning for Time Series Forecasting: Predict the Future with MLPs, CNNs and LSTMs in Python; Machine Learning Mastery: Melbourne, Australia, 2018. [Google Scholar]
- Jiao, E.X.; Chen, J.L. Tourism forecasting: A review of methodological developments over the last decade. Tour. Econ.
**2019**, 25, 469–492. [Google Scholar] [CrossRef] - Li, G.; Song, H.; Witt, S.F. Recent Developments in Econometric Modeling and Forecasting. J. Travel Res.
**2005**, 44, 82–99. [Google Scholar] [CrossRef] [Green Version] - Hong, W.-C.; Dong, Y.; Chen, L.-Y.; Wei, S.-Y. SVR with hybrid chaotic genetic algorithms for tourism demand forecasting. Appl. Soft Comput.
**2011**, 11, 1881–1890. [Google Scholar] [CrossRef]

**Figure 1.**Graphical representation of the support vector regression. *, Training data points. Source: Authors own elaboration.

**Figure 4.**Forecasting results for the Marrakech-Safi region with all models: (

**a**) Shows the forecasting results for the Marrakech-Safi region of the three conventional methods with the real data; (

**b**) shows the forecasting results for the Marrakech-Safi region of the three AI-based models with the real data.

Accuracy Metrics | Formula |
---|---|

RMSE | $\sqrt{\frac{{{\displaystyle \sum}}_{n=1}^{N}{\left({y}_{t}-{\widehat{y}}_{t}\right)}^{2}}{N}}$ |

MAPE | $\frac{1}{N}{\displaystyle \sum _{n=1}^{N}}\frac{\left|{y}_{t}-{\widehat{y}}_{t}\right|}{{y}_{t}}*100$ |

MAE | $\frac{{{\displaystyle \sum}}_{n=1}^{N}\left|{y}_{t}-{\widehat{y}}_{t}\right|}{N}$ |

Model | MAE | RMSE | MAPE (%) | |
---|---|---|---|---|

Conventional Models | ARIMA | 214,158.6175 | 241,754.5817 | 10.841468 |

AR | 269,820.0817 | 303,538.1567 | 12.99072 | |

Lin_Reg | 154,085.0944 | 185,612.9382 | 7.195004 | |

AI-Based Models | XGBoost | 211,996.5625 | 259,479.9072 | 9.692244 |

SVR | 262,583.4312 | 347,404.7287 | 11.876725 | |

LSTM | 130,324.425 | 154,514.3182 | 6.272656 |

Approach | Model | Time to Implement Each Strategy |
---|---|---|

Traditional techniques | AR | 17,949 μs |

ARIMA | 687,695 μs | |

Linear Regression | 1005 μs | |

AI-based models | LSTM | 11 s |

SVR | 14 s | |

XGBoost | 676,290 μs | |

Ensemble learning | LSTM_AR | 46,406 μs |

LSTM_Linear | 989,630 μs | |

LSTM_ARIMA | 474,366 μs | |

XGBoost_ARIMA | 178,725 μs |

Model | MAE | RMSE | MAPE (%) |
---|---|---|---|

LSTM_AR | 128,462.6305 | 149,117.1278 | 6.127097 |

LSTM_LINEAR | 133,713.4925 | 169,222.7763 | 6.538672 |

LSTM_ARIMA | 165,065.2356 | 211,778.9905 | 7.548610 |

XGBOOST_ARIMA | 203,038.5896 | 219,668.8450 | 9.800446 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ouassou, E.h.; Taya, H.
Forecasting Regional Tourism Demand in Morocco from Traditional and AI-Based Methods to Ensemble Modeling. *Forecasting* **2022**, *4*, 420-437.
https://doi.org/10.3390/forecast4020024

**AMA Style**

Ouassou Eh, Taya H.
Forecasting Regional Tourism Demand in Morocco from Traditional and AI-Based Methods to Ensemble Modeling. *Forecasting*. 2022; 4(2):420-437.
https://doi.org/10.3390/forecast4020024

**Chicago/Turabian Style**

Ouassou, El houssin, and Hafsa Taya.
2022. "Forecasting Regional Tourism Demand in Morocco from Traditional and AI-Based Methods to Ensemble Modeling" *Forecasting* 4, no. 2: 420-437.
https://doi.org/10.3390/forecast4020024