Abstract:
Temperature forecasting is a essential component in numerous sectors including agri-
culture, health, disaster management, and water resources. Precise predictions are
vital for decision-making and planning, especially in regions with complex climatic
patterns like Machakos County, Kenya. Traditional statistical models fail to capture the
nonlinear and inter-variable relationships in temperature data, necessitating advanced
approaches. This study addressed this gap by applying a Long Short-Term Memory
(LSTM) model to predict daily temperatures in Machakos County. The key objective of
the project was to model daily temperature using Long short term memory network that
can provide precise temperature forecasts, with specific goals including the fitting of the
LSTM model, Comparison of performance the model with Auto Regressive Integrated
Moving Average(ARIMA), Predicting thirty days daily average ground temperature
and assessing perfomance of LSTM model as prediction period advances.
The study involved pre-processing of NASA POWER project data set, followed by
exploratory analysis of data and then fitting requisite model using python programming
language. Mean Absolute Error, Root Mean Squared Error, Mean Absolute Percentage
Error and Diebold-Mariano statistical test was used to assess model Performance fol-
lowed by comparison and forecasting.
The study established that ARIMA and LSTM performance is equivalent in Short term
predictions (7-days) at 5% level while Long Short Term Memory model outperforms
ARIMA in long term predictions (30-days) at the same level. LSTM was used for
forecasting of 30 days temperature with lower error of 0.91 ◦C