Back to Projects

Evaluation of Domestic Electricity Cost in Relation to Hydroelectric Energy and Rainfall Using Matrix Completion Method in Kenya

Complete
R&DArticle

Authors

Samuel Wachira

ORCID iD

Correspondent Author

sct2540052021@mmu.ac.ke

Co-Authors:

Clivia Mwangi, Charity Mwaura, Emmaculate Mwangi, Whitney Okore

Abstract

This research explores how rainfall impacts energy generation and the pricing of household electricity in Kenya during the study period from July 2023 to June 2024. Despite a rise in hydroelectric power output in rainy seasons, electricity prices have stayed elevated, showing a discrepancy in pricing. The objectives of this project are to evaluate the cost of domestic electricity during high precipitation periods and to apply collaborative filtering techniques to examine the data, uncover patterns and trends in electricity pricing. Cosine similarity is employed to assess the correlation between rainfall, hydroelectric production and electricity costs. We use data from the World Food Programme for rainfall, Hydropower generation from the Energy Petroleum Regulatory Authority (EPRA) bi-annual reports of 2023/2024 and domestic electricity cost from Stima Tracker. The findings suggest that while rainfall positively influences hydroelectric output, its impact on domestic electricity pricing is mitigated by external economic and regulatory factors. Collaborative filtering techniques, particularly cosine similarity, are effective for forecasting within hydroelectric systems. However, electricity cost prediction must also account for policy, infrastructure, and market dynamics to improve accuracy and support fair tariff setting.

Keywords:

Hydroelectric EnergyDomestic Electricity CostRainfallMatrix CompletionCollaborative FilteringCosine Similarity

Introduction

Collaborative Filtering (CF) is a machine learning technique traditionally used in recommendation systems to predict the preferences or behaviors of users by analyzing patterns in existing data. It operates by identifying similarities between users or items based on historical interactions—such as rating movies, purchasing products, or selecting content—and making predictions accordingly. CF techniques can be broadly categorized into memory-based and model-based approaches. Memory-based algorithms, like cosine similarity and Pearson correlation, directly compute similarities across the data matrix, while model-based approaches employ machine learning models to capture latent relationships. Though widely recognized for its role in platforms like Netflix or Amazon, Collaborative Filtering has evolved into a powerful tool for uncovering hidden patterns in non-user domains such as energy forecasting, sensor networks, and public policy.

In this research, Collaborative Filtering is applied as a matrix completion technique to predict domestic electricity costs based on rainfall and hydroelectric energy output. By constructing a 3×3 matrix with time-series data covering rainfall (mm), hydroelectric power output (GWh), and electricity cost (KES/kWh) across quarterly intervals, the cosine similarity method (a memory-based CF algorithm), was used to fill in missing or unknown data points. Normalization via z-score allowed for fair comparisons across variables with different units. This enabled researchers to assess the degree of correlation between seasonal rainfall and energy pricing, revealing whether high hydroelectric production, driven by rainfall, translated into reduced electricity costs. The analysis uncovered key insights into the temporal mismatches between rainfall patterns, hydroelectric output, and actual consumer prices, which would not be easily visible through traditional statistical methods.

The integration of Collaborative Filtering in this energy study brings multiple benefits. First, it enhances predictive accuracy in contexts with incomplete or sparse datasets, which is common in developing regions with limited real-time infrastructure. Second, it reveals deeper, non-linear relationships between weather patterns and energy pricing, allowing for better energy policy formulation. Most importantly, the project directly contributes to United Nations Sustainable Development Goal (UNSDG) 7: Ensure access to affordable, reliable, sustainable and modern energy for all. By identifying discrepancies between increased hydroelectric production and persistent high consumer prices, this study provides evidence-based insights for regulators like EPRA to implement fairer tariffs and possibly develop subsidies for low-income households. Ultimately, the approach supports energy affordability and sustainability, two critical targets under SDG 7.

UN Sustainable Development Goal 7: Affordable and Clean Energy

Research Challenges

Data Quality and Availability

Collaborative Filtering algorithms are highly dependent on the completeness and accuracy of the input data. In many developing countries, access to consistent datasets on rainfall, electricity costs, and hydroelectric output is limited. Missing or outdated data can lead to unreliable forecasts or incomplete modeling.

Scalability and Computational Constraints

Memory-based methods like cosine similarity can become computationally expensive as the dataset grows. Without optimized data structures or preprocessing, these methods may be slow or fail to scale in real-time applications.

External Influences Beyond CF

Electricity pricing is not determined solely by hydroelectric output and rainfall; factors like fuel levies, currency devaluation, and infrastructure costs play a major role. Collaborative Filtering does not inherently account for these economic and policy-driven influences.

Call to Action for Researchers

1. Develop Hybrid Models: Combine Collaborative Filtering with reinforcement learning, time-series models, or economic regression techniques to improve prediction accuracy. 2. Advocate for Open Data: Encourage national agencies (like EPRA, KenGen, and meteorological departments) to release timely, granular data for public research use. 3. Expand to Other Contexts: Replicate this study in other Sub-Saharan African nations to compare trends and enhance regional energy resilience. 4. Explore Equity Implications: Study how accurate pricing forecasts can help design subsidies or policies for low-income households, advancing equity in energy access.

Publication Details

Venue

NextResearch Papers, ScienceDirect (Elsevier)

Publication Date

XX-XX-XXXX

Location

Nairobi, Kenya

Status

Under Review

DOI

10.XXX/XXXXXXXXXX

Citations

0 citations

Pages

44

ISBN

XXX-XXX-XXX-XXX-X