Coders.dev Partner

Optimizing ATM Cash Management with Seasonal Cash Demand Forecasting

ATM Cash Management
Article

The article discusses the creation of an intelligent cash management system, such as in ATMs, based on cash demand forecasting. The system aims to overcome unpredictability across ATMs due to various factors such as mobile users, paydays, holidays, and seasonal demand per region. The benefits of the system include reduced financial costs due to unused stocked cash and daily forecasts for deposits and withdrawals that can help the bank more efficiently distribute its money across ATMs and branches, improving the return on their cash assets. The article provides an example code for building a cash demand forecasting model for each ATM using Python and the Prophet library. The code involves importing required libraries, loading historical data, visualizing data to identify seasonal trends, creating and training a Prophet model, making future predictions, and plotting forecasted cash demand. The article emphasizes adjusting the model parameters as necessary to optimize the accuracy of the cash demand forecast.

 

Objective

  • Create an intelligent cash management system (eg, in ATMs) based on cash demand forecasting; predict cash demand
  • Overcome unpredictability across ATMs (eg, mobile users, paydays, holidays, seasonal demand per region)

Business Value

  • Reduced financial costs due to unused stocked cash that accumulates interest paid to the Central Bank
  • Daily forecasts for deposits and withdrawals that helped the bank to more efficiently distribute its money across ATMs and branches, improving the return on their cash assets. 

Solution

Here's an example code for building a cash demand forecasting model for each ATM based on historical cash demand data and seasonal trends using Python and the Prophet library.

First, we need to install the required libraries. Open your terminal or command prompt and type the following commands:

pip install panda
pip install matplotlib
pip install fbprophet

Next, we need to import the required libraries and load the historical data. Here's an example code for doing that:

import pandas as p
import matplotlib.pyplot as plt
from fbprophet import Prophet

# Load historical data
df = pd.read_csv('historical_data.csv')
df['ds'] = pd.to_datetime(df['ds'])

In this example, historical_data.csv is the file containing the historical data. The ds column should contain the dates in a YYYY-MM-DD format.

Next, we can visualize the data to identify any seasonal trends using the following code:

# Plot historical dat
plt.plot(df['ds'], df['y'])
plt.xlabel('Date')
plt.ylabel('Cash demand')
plt.show()

This code will generate a plot of the historical cash demand data over time.

After identifying any seasonal trends, we can use the Prophet library to create a forecasting model. Here's an example code for doing that:

 

# Create and train mode model = Prophet() model.fit(df) # Make future predictions future = model.make_future_dataframe(periods=365) forecast = model.predict(future) # Plot forecast model.plot(forecast) plt.xlabel('Date') plt.ylabel('Cash demand') plt.show()

In this code, we first create a Prophet object and train it using the historical data. We then use the trained model to make future predictions for the next 365 days. Finally, we plot the forecasted cash demand using the plot method.

You can repeat these steps for each ATM and adjust the model parameters as necessary to optimize the accuracy of the cash demand forecast.