Pre-budget analysis: detecting expense behavior

Hi everyone,

Before constructing myself a “budget” in the classical sense, I’m trying to do some pre-budget analysis to better understand my spending behavior and how it changes over time. Especially in an inflationary environment where fixed monthly limits monthly become meaningless.

What I’m trying to do

Instead of asking “did I exceed my budget this month?”, I’m trying to answer:

  • Did my spending behavior change compared to my own recent history?

  • Was this month’s expense increase/decrease unusual relative to past months?

So the focus is not absolute expense levels, but expense change speed over time.

Data source

  • All data ultimately comes from hledger. Hledger is -M -p 2025 -2

  • I can export monthly aggregated expense data via hledger (Directly calling shell from VBA).

  • Excel is used as an analysis layer, mostly for its graphing capabilities. This idea can be implemented with any scripting language.

Current approach

  1. From hledger, I extract monthly total expenses (already aggregated by hledger).

  2. In Excel, I compute:

    • Monthly expense EMA (3 months exponantial moving average) for smoothing the “signal”.

    • A rolling band (Rolling percentiles (%10-%95)) around this change series, based on historical behavior.

The idea is:

  • If the current month’s expense moves outside its historical band , that’s a signal worth investigating.

  • The band represents “my own normal behavior”.

Why this instead of a classic budget?

  • High inflation → fixed monthly numbers age quickly.

  • I think i can limit myself better with behavioral alerts, not rigid limits.

Once a spike or drop is detected, I then drill down into categories or individual postings to understand why.

This is admittedly not a “clean” or widely distributable setup, but it allows fast iteration.

What I’d like feedback on

  • Does this “pre-budget behavioral band” approach make sense to you?

  • Are there better statistical ways (within or outside hledger) to detect abnormal expense behavior over time?

  • Has anyone tried something similar directly in hledger reports, or do you also rely on an external analysis layer?

I’m not trying to replace hledger’s budgeting features—more like feeding them better intuition before committing to a budget structure.

Any thoughts, critiques, or pointers would be very welcome.

Here is a screenshot:

1 Like

I think this is a good approach, and it works well. I think using the income statement as a baseline is clever actually. I don’t have any specific critique.

I guess for me the point where I have difficulty with budgets is that they separate execution and planning.

Most budgeting approaches and tools have three layers:

  1. The planning layer (limits, forecasts etc.)
  2. Execution layer (transactions)
  3. Reconciliation layer (variance reports)

To be clear this mostly works, but in my view; the plans can be easily and silently violated, execution can drift from intent, reconciliation becomes a post hoc excercise.

So for the better part of 15 years I have used zero balance /envelope budgeting, for the last using 5 plain text.

In zero balance accounting there are only transaction. Planning is a transaction. When I allocate funds to plan expenditure it is a transaction:

25-12-16 income
      Assets:Bankwest:transaccount:Entertainment              $193.71
	Assets:Bankwest:transaccount:Car:Fuel            $279.54
	Assets:Bankwest:transaccount:Car:Insurance       $110.65
	Assets:Bankwest:transaccount:Car:Registration    $123.46

This isn’t a note, a rule, a UI overlay, it is a plan.

Execution is also a transaction:

Assets:Cash:Maintenance   -$180
Expenses:Auto:Service      $180

The system doesn’t distinguish between “planned money” and “real money” because they are the same money.

The balance sheet therefore encodes intent. If I have $125 in Car:Service:My_Supercar, that $125 is intended to be spent on the super car, not Groceries or Entertainment. That capital is earmarked for a specific future liability or consumption class.

Therefore if any sub account is negative, I have violated policy and am borrowing from the future (or another future liability).

Intent really restricts a given dollars future legal moves.

So my balance sheet reflects intent as well as performance.

This might not be helpful to you exactly though I don’t think it’s to far removed from what you’re doing because your income statement is a record of performance and your reviews are pretty good. And if you have the discipline to implement planning and execution separately I think you should keep on keeping on.