In this tutorial I will show you how to model a seasonal time series through a SARIMA model.

Here you can download the Jupyter notebook of the code described in this tutorial.

Getting Started

Convert the dataset into a time series

In this example we will use the number of tourist arrivals to Italy. Data are extracted from the European Statistics: Annual Data on Tourism Industries. Firstly, we import the dataset related to foreign tourists arrivals in Italy from 2012 to 2019 October and then we convert it into a time series.

In order to perform the conversion to time series, two steps are needed:

  • the column containing dates must be converted to datetime. This can be done through the function to_datetime(), which converts a string into a datetime.
  • set the index of the dataframe to the column containing dates. This can be done through the function set_index() applied to the dataframe.

#data-analysis #data-science #sarima #time-series-analysis #time-series-forecasting

How to model a time series through a SARIMA model
2.45 GEEK