  Due to population increase and import constraints, maize, a key cereal crop
in Africa, is experiencing a boom in demand. Given this, the study's focus is
on determining how maize output in Nigeria interacts with various climatic
factors, particularly rainfall and temperature. The Hidden Markov Model (HMM)
and the Long Short-Term Memory neural network (LSTM) are compared in this
context to assess their performance. A variety of performance indicators, such
as correlation, mean absolute percentage error (MAPE), standard error of the
mean (SEM), and mean square error (MSE), are used to evaluate the models. The
outcomes show that the HMM performs better than the LSTM, with an RMSE of 1.21
and a MAPE of 12.98 demonstrating greater performance. Based on this result,
the HMM is then used to forecast maize yield while taking the effects of
temperature and rainfall into account. The estimates highlight the possibility
for increasing local output by demonstrating a favorable environment for maize
planting in Nigeria. In order to help the Nigerian government in its efforts to
increase maize production domestically, these studies offer useful insights.
