This repository contains Python scripts for analyzing and forecasting time series data. The analysis is based on a dataset of monthly sales data, which is evaluated for stationarity and then forecasted using ARIMA and SARIMAX models.
- Python 3.10
- Libraries:
- seaborn
- numpy
- pandas
- matplotlib
- statsmodels
The data is expected to be a CSV file named month sales.csv
, containing monthly sales data. Make sure to place this file in the appropriate directory or update the file path in the code accordingly.
The script performs the following tasks:
- Loads the monthly sales data from a CSV file
- Converts the month column to datetime format and sets it as the index
- Plots the sales data
- Conducts the Augmented Dickey-Fuller test to check for stationarity
- Differentiates the data to achieve stationarity, if necessary
- Plots the autocorrelation and partial autocorrelation plots
- Fits ARIMA and SARIMAX models to the data
- Predicts future sales and plots the forecasts
To execute the script, simply run the provided Python file in a suitable environment, such as Jupyter Notebook or directly on a Python interpreter.
The script will generate plots visualizing the original sales data, the differentiated data to achieve stationarity, the autocorrelation and partial autocorrelation plots, and the forecasted sales data using ARIMA and SARIMAX models.