Skip to content

Anomaly Detection in Finance Data

By Newtown Analytics · · 9 min read

For finance, fp&a & accounting managers

Anomaly detection in finance data is the practice of finding transactions, balances or trends that are unusual enough to deserve a human look, and it is a core part of business analytics for finance and operations. The anomalies might be errors, such as a decimal point in the wrong place, process failures, such as a duplicate payment, or in rare cases fraud. Most finance teams already do a manual version: scanning variance reports for numbers that look odd. Automated methods scale that instinct across thousands of accounts, vendors and transactions every month. The point is not to replace judgment but to direct it. A good system produces a short, ranked list of items worth checking, with enough context to decide quickly. A bad one buries reviewers in false alarms until they stop looking. This guide explains the main approaches, works through a statistical example with checked arithmetic, shows how to plan for false alarms, covers workflow and controls and lists common mistakes. It follows AI in FP&A and AI in finance, and leads to churn prediction and analytics automation. It supports controls around budgeting and forecasting and cash flow management.

What counts as an anomaly

An anomaly is a data point that departs from the expected pattern. Three types are useful to distinguish.

  1. Point anomalies: a single value that is far from the rest, such as an expense of $95,000 in an account that normally shows about $50,000.
  2. Contextual anomalies: a value that is normal in general but odd for its context, such as a large payment on a weekend or a high revenue figure in a month that is usually low.
  3. Collective anomalies: a group of values that are individually normal but unusual together, such as many payments just under an approval limit, or a series of small increases that add up.

Not every anomaly is a problem. A large purchase may be legitimate. The system's task is to surface it, and the reviewer's task is to explain it.

Approaches, from simple to advanced

1. Rules and business logic. Explicit checks: duplicate invoices (same vendor, amount and date), payments above a threshold, entries posted outside business hours, round-number journal entries, invoices without purchase orders, vendors with missing tax information, payments to new bank accounts. Rules are transparent and easy to explain, and they catch known problems. They miss new ones.

2. Statistical methods. Compare each value with the history of its own series using measures of spread. The z-score expresses how many standard deviations a value is from the mean. The interquartile range method flags values beyond 1.5 times the interquartile range outside the quartiles. For data with seasonality, compare a value with the same month in prior years, or with a forecast, and flag large forecast errors.

3. Machine learning methods. Algorithms such as isolation forests, clustering and autoencoders learn the normal shape of multi-dimensional data and flag points that do not fit. They can catch combinations of features that rules miss, but are harder to explain and require tuning and monitoring.

4. Benchmarking and peer comparison. Compare a cost center or vendor with its peers, or a month's ratio with the typical ratio, such as freight as a share of sales.

Start with rules and statistics. They find most of the value, and the review process matters more than the sophistication of the algorithm.

A worked z-score example

A monthly expense account shows these values for nine months, in thousands of dollars (hypothetical): 52, 48, 50, 55, 49, 51, 47, 53, 50. The tenth month is 95.

  • Mean of the nine months: (52 + 48 + 50 + 55 + 49 + 51 + 47 + 53 + 50) / 9 = 455 / 9 = 50.56
  • Squared deviations from the mean: 2.09, 6.53, 0.31, 19.75, 2.42, 0.20, 12.64, 5.97 and 0.31, totaling 50.22
  • Sample variance: 50.22 / 8 = 6.28; standard deviation: the square root of 6.28 = 2.51
  • Z-score of 95: (95 - 50.56) / 2.51 = 44.44 / 2.51 = 17.7

A value 17.7 standard deviations from the mean is an unmistakable outlier. Check the sum of squares by adding the nine values: 2.09 + 6.53 = 8.62; + 0.31 = 8.93; + 19.75 = 28.68; + 2.42 = 31.10; + 0.20 = 31.30; + 12.64 = 43.94; + 5.97 = 49.91; + 0.31 = 50.22. Now compare a milder value of 58: its z-score is (58 - 50.56) / 2.51 = 2.97, just under a typical threshold of 3. Whether 58 matters depends on the account. It is a 15 percent rise over the mean, and a human might want to know why.

Two cautions come out of the example. First, the statistic is only as good as the history: an account with a trend or seasonality needs a model that accounts for it, or the system will flag every December. Second, outliers in the history distort the mean and standard deviation, so robust versions using the median and median absolute deviation are often better in practice.

Planning for false alarms

Any threshold produces false positives. If values were perfectly normally distributed, about 0.27 percent would lie beyond three standard deviations in either direction (roughly 1 in 370). Across 1,000 account-months, that is about 2.7 flags with nothing wrong. Real data is not perfectly normal, and the number is often higher. If you screen 20,000 transactions a month and the system flags 2 percent, that is 400 items. If a reviewer can check 10 an hour, it takes 40 hours. Ask three questions: How many items can the team review? What is the cost of missing a real problem? What is the cost of a false alarm? Then tune the thresholds to produce a review list of a size the team can handle, ranked by dollar value and risk. Ranking is more useful than a hard cutoff: sort flagged items by amount times anomaly score, and review from the top.

A duplicate-payment rule can pay for itself quickly. If the rule flags three invoices at $4,250 each that were paid twice, the recovered amount is 3 × 4,250 = $12,750. That is a concrete, easy-to-explain benefit that helps win support for the program.

Giving reviewers context

A flag without context is a chore. For each item, show the amount, the account, the vendor or customer, the date, the history of the series, the reason it was flagged and links to the supporting document. Provide actions: mark as explained (with a reason), escalate or correct. Capture the reasons, since they are valuable. If reviewers repeatedly mark one type of flag as normal, adjust the rule, or add the context that explains it, such as a quarterly bill that always lands in the same month. If a type of flag keeps finding real errors, move the control upstream so that it prevents the error.

Workflow and controls

  1. Define the scope: which data sets (payments, journal entries, expense reports, inventory adjustments, price changes).
  2. Define the checks and thresholds, and the owner for each.
  3. Run on a schedule, matched to the process: daily for payments, monthly for journals.
  4. Route flags to the person with knowledge of the item, with a due date.
  5. Document outcomes: explained, corrected or escalated, with the reason.
  6. Escalate potential fraud or policy breaches through a defined, confidential channel.
  7. Review the program: false positive rate, true positive findings, recoveries, time spent.
  8. Protect independence: the person who raises a transaction should not be the only person who clears its flag.

Anomaly detection supports internal control, and does not replace it. Segregation of duties, approvals and reconciliations remain the first line of defense. Involve internal audit or your external auditors in the design.

Applying the idea beyond transactions

The same approach works for operational data. Flag items whose demand suddenly departs from forecast, so planners can check for data errors or real shifts. Flag inventory records with negative or implausibly large balances. Flag price changes that move margin out of range. Flag customers whose payment behavior has changed. Treat these as prompts for investigation, not as conclusions. See demand planning and inventory optimization.

Common mistakes

  1. Starting with advanced algorithms before simple rules.
  2. No capacity planning for reviews, so the list overwhelms the team.
  3. Ignoring seasonality and trends, leading to constant false alarms.
  4. No feedback loop from reviewers to rules.
  5. Treating a flag as proof of wrongdoing.
  6. Not protecting confidentiality of investigations.
  7. Setting thresholds once and never revisiting them.
  8. Not measuring results.

Seasonality changes the answer

A simple z-score applied to a series with a seasonal pattern gives misleading results. Take a utilities cost with these monthly values, in thousands of dollars (hypothetical): 40, 40, 38, 36, 35, 42, 60, 62, 41, 37, 38, 41. The mean is 510 / 12 = 42.5 and the sample standard deviation is about 8.9. The summer peak in July and August (60 and 62) has z-scores of (60 - 42.5) / 8.9 = 1.96 and (62 - 42.5) / 8.9 = 2.19, below a threshold of 3, so the peak does not raise an alarm, which is correct. But consider an unusual February of 50, where the normal range is 38 to 42. Its z-score is (50 - 42.5) / 8.9 = 0.84, so the simple method would not flag it, even though it is 25 percent above the previous February of 40. A seasonal comparison, which checks each month against the same month in prior years or against a seasonal forecast, flags the February reading at once. The lesson is to compare like with like: use the same period last year, a seasonal baseline or a forecast, and measure the departure from that.

Standard tests for journal entries

Finance teams commonly run a set of tests on manual journal entries each period. Typical tests look for entries posted on weekends or holidays or outside normal hours; entries by users who rarely post; round-dollar amounts; entries just below approval limits; entries to rarely used accounts or to accounts that seldom appear together; entries posted after the period closed; entries with vague descriptions; reversals that never reverse; and large entries at period-end. None proves a problem, but each focuses attention. Run the tests every period, record the results and the explanations, and add new tests when a problem is found.

Documenting for auditors

Auditors and regulators appreciate a clear description of the monitoring: what is tested, how often, the thresholds, who reviews, what happens to exceptions and how results are retained. Keep the logic under version control and the review evidence in a retrievable form. Test the system from time to time by planting a known exception and confirming that it is caught. Show that the control operates over the period and that exceptions are resolved in a reasonable time. A well-documented program becomes part of the company's control framework and can reduce audit effort.

FAQs

What is anomaly detection in finance?

Using rules, statistics or machine learning to find transactions, balances or trends that are unusual enough to merit review.

What methods are used?

Business rules such as duplicate checks, statistical methods such as z-scores and the interquartile range, and machine learning methods such as isolation forests.

How do I avoid too many false alarms?

Tune thresholds to the team's review capacity, rank items by value and risk, account for seasonality, and use reviewer feedback to refine the rules.

Does anomaly detection find fraud?

It can surface suspicious patterns, but a flag is a prompt for investigation, not proof. Most flags have innocent explanations.

Where should I start?

With a few high-value rules such as duplicate payments and unusual journal entries, run monthly, with a defined review and documentation process.

This article is for general information. It is not accounting, tax, legal or investment advice, and examples use illustrative numbers rather than client data. Confirm decisions that carry financial or legal consequences with a qualified professional.

Better forecasts. Healthier inventory. More working capital.

Newtown Analytics advises growing consumer-product companies on demand planning and inventory optimization.