Commodity Management Reimagined Blog

A Machine Learning Approach for Cash Flow Prediction

Written by Vinayak Mungurwadi | August 14, 2015 // 2:45 PM

There is a saying that "revenue is vanity, profit is sanity, but cash is reality." Revenue alone is not a reliable metric of business health, as an enterprise’s revenue may go up yet its profits may go down. In business, what matters most is profit. But profit calculations are based on various assumptions.

  • If a company buys something for $200 and sells it for $250, then it made a profit of $50.
  • But if the invoice is never paid by the seller, the company receives no revenue from the sale, and the cash available from that sale is $0.

Available cash in the bank is the reality.

Predicting Cash Flows

Predicting cash flows is a quantitative estimate of cash inflow and outflow for future periods. For any commodity trading firm, efficient management of accounts receivable is more challenging than accounts payable because accounts receivable are dependent on factors not controlled by the firm. In the long run, accounts receivable also impact accounts payable. (How quickly your customers pay their bills impacts how quickly you can pay your bills.)

Current Industry Practice and its Limitations

An invoice shows the payment due date by which the customer should pay the supplier. The majority of current cash flow prediction methods assume that invoices will be paid before or on their due date — an inaccurate assumption. Robust cash flow predictions should consider the probabilistic nature of the invoice payment date.

A Better Way

A realistic method for predicting cash flows should account for both situations: when an invoice is paid on time and when it is not. Predicting cash flows should include the expected payment date of open invoices, knowing that they won't all be paid on time. Statistical models are ideally suited for these types of problems. The expected payment date can be mathematically predicted with a statistical model that factors in cash flow as an input.

Factors Impacting Cash Flow

The probability that a counterparty will pay its invoices on time depends on many factors, including:

  • Macroeconomic factors
  • Cash richness or previous payment behavior of the counterparty
  • Total amount of the invoice
  • Product price shown on the invoice
  • Payment terms (allowable number of days to pay before payment is considered late)
  • Operational issues including: incorrect numbers on the invoice, incorrect bank details on the invoice, invoice adjustments, netting off (open invoices from the counterparty), quality disputes on product delivered

In addition, the payment behavior of a counterparty may vary over time or amongst different types of invoices.

A Predictive Model

Working together, data scientists and commodity market participants can determine:

  • Is there a pattern in a given counterparty's payment behavior?
  • Is it possible to use the power of machine learning to forecast if an invoice will be paid on time or not?

Eka has developed a method to model the payment behavior of counterparties. The model analyzes historical behavior of a counterparty on invoices raised and then finds patterns in payment behavior over different invoice parameters. We can extrapolate observed payment behavior of the counterparty to predict the expected payment date on a newly raised invoice. The model is based on a state-of-the-art machine learning algorithm projective adaptive resonance theory (PART) to classify the expected payment date of an invoice into different pre-determined time periods.

Machine learning is a scientific discipline that explores the construction and study of
algorithms that can learn from data. Such algorithms operate by building a model
from example inputs and using that to make predictions or decisions,
rather than following strictly static program instructions.

Model Output

The output of Eka's model is the time period in which an open invoice is expected to be paid, such as before the invoice due date or within 15 days after due date. Users specify custom time periods as predefined input. The figure below shows an example of aggregated output of the model.

In this example set of inputs, the model predicts:

  • 45.81% of open invoices will be paid on or before their due date
  • 51.61% will be paid within 15 days after the due date
  • 2.26% will be paid between 15 and 45 days late
  • 0.32% will be paid 45-90 days late
  • 0% will be paid more than 90 days late

Eka's cash flow prediction model provides these benefits:

  • Predicting upcoming cash surpluses and shortages to enable commodities companies to make better, fact-based decisions around potential investments or borrowing opportunities.
  • Improving collection management by highlighting invoices that are expected to have a significant delay so that the commodity company can take preventive measures to facilitate timely payment (such as following up with the customer immediately).
  • Projecting the counterparties that are mostly likely to pay invoices late.
  • Identifying the parameters that have correlation with invoice payment behavior.

Eka harnesses the data from all applications, enabling commodities companies to get answers to the most critical questions. Providing an end-to-end analysis of the entire enterprise, Eka's apps span multiple categories including cash flow, positions, P&L, trading, risk, credit, finance, supply chain, reconciliation, counterparties, and more.

Eka has developed models for such use cases as optimizing natural gas inventory using linear programming and increasing throughput at bulk material handling sites using the Internet of Things (IoT).