# Short-term forecasting of Indonesia electricity generation using MATLAB based on NARX neural network

**Authors:** Nicholas Pranata, Fahmy Rinanda Saputri

PMC · DOI: 10.1371/journal.pone.0340268 · 2026-02-04

## TL;DR

This paper uses a NARX neural network in MATLAB to accurately predict Indonesia's electricity generation for one year ahead.

## Contribution

The study introduces a MATLAB-based NARX model for short-term electricity generation forecasting in Indonesia.

## Key findings

- Both Levenberg-Marquardt and Bayesian Regularization algorithms achieved R² values above 0.9.
- The models had a Mean Absolute Percent Error (MAPE) of under 3%.
- Levenberg-Marquardt showed slightly better performance than Bayesian Regularization.

## Abstract

Electricity consumption, production, and supply based on fossil fuels have increased due to population growth, urbanization, and technological development, leading to environmental damage in countries like Indonesia. In response to this issue, electricity forecasting is essential. This study applies to a Nonlinear Autoregressive with Exogenous Input (NARX) neural network to forecast one year ahead of electricity generation using MATLAB. Two algorithms are used for comparison: Levenberg-Marquardt and Bayesian Regularization. The data is classified using a standard method of 70%−30% split, with 30 hidden layers and a standard delay of 2-time steps. The results show that both algorithms achieve an R² value above 0.9 and a Mean Absolute Percent Error (MAPE) of under 3%, with the Levenberg-Marquardt algorithm demonstrating marginally superior performance. These results indicate that the model provides valuable insights for forecasting annual electricity generation in Indonesia over a short timeframe.

## Full-text entities

- **Chemicals:** NARX-NN (-)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Figures

17 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12871995/full.md

---
Source: https://tomesphere.com/paper/PMC12871995