This project focuses on analyzing and forecasting temperature data in Latvia from 2018 to 2023. The analysis is performed using various time series analysis techniques and models.
The project involves the following steps:
- Data Preparation: Loading and preparing the temperature data from a CSV file.
- Time Series Analysis: Performing various analyses on the time series data, including seasonal decomposition and autocorrelation plots.
- Model Training: Training ARIMA and SARIMAX models on the temperature data to forecast future temperatures.
- Forecasting: Using the trained models to predict future temperatures and visualizing the results.
- Validation: Validating the forecast results using metrics like Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE).
The initial data is loaded from a CSV file and prepared for analysis:
import pandas as pd
# Load the data
temp = pd.read_csv("/tempo.csv")
# Change column names
temp.columns = ["Mēnesis", "Temperatūra"]
# Convert date column to datetime
temp["Mēnesis"] = pd.to_datetime(temp["Mēnesis"])
# Set date column as index
temp.set_index("Mēnesis", inplace=True)