🧠 Cognitive Bias in Financial Markets

Herding, anchoring, and loss aversion distort prices from fundamental value. Heterogeneous agent model: fundamentalists vs chartists. See bubbles, crashes, and fat-tailed return distributions.

EconomicsInteractive
Green = price · Dashed = fundamental value · P pause · R reset

How it Works

This simulation implements a heterogeneous agent model of a financial market. Two types of traders interact: fundamentalists who trade toward the fundamental value V (mean-reverting), and chartists (trend followers) who extrapolate recent price momentum.

Cognitive biases modify trader behavior: herding amplifies trend-following, loss aversion creates asymmetric response to gains vs losses (sellers overreact to falling prices), and anchoring causes traders to anchor to a remembered price level that adjusts slowly.

Fundamental value: V_t = V_{t-1} · exp(noise + drift) Anchor: A_t = α·A_{t-1} + (1-α)·P_{t-1} Fundamentalist demand: D_F = β_F · (V_t − P_t) Chartist demand (with herding + loss aversion): momentum = P_{t-1} − P_{t-2} if momentum < 0: scale by λ (loss aversion) D_C = β_C · momentum · (1 + h · |momentum|) Price update: P_t = P_{t-1} + μ·(D_F·n_F + D_C·n_C) + σ·ε

When chartists dominate, prices depart from fundamentals (bubbles). When fundamentalists dominate, prices revert. The interplay creates realistic patterns: volatility clustering, fat tails, and occasional crashes.

Frequently Asked Questions

What is behavioral finance?

Behavioral finance studies how psychological biases and cognitive errors cause investors to deviate from rational actor assumptions. Key findings include overconfidence, loss aversion, herding, and anchoring, all of which distort asset prices from fundamental value.

What is herding behavior in markets?

Herding occurs when investors follow the crowd rather than their own information. This creates price momentum, amplifies trends, and can produce bubbles. Herding arises from social pressure, reputational concerns, or information cascades where individuals infer private signals from others' behavior.

What is loss aversion?

Loss aversion (Kahneman & Tversky, 1979) is the tendency to weight losses approximately twice as heavily as equivalent gains. This leads to the disposition effect (selling winners too early, holding losers too long) and excessive risk aversion in the gain domain.

What is anchoring bias?

Anchoring is the tendency to rely too heavily on an initial piece of information. In markets, investors anchor to recent prices, 52-week highs, or historical averages. This slows adjustment to new information and creates price levels that act as support or resistance.

What is the heterogeneous agent model?

Heterogeneous agent models replace the representative rational agent with a population of traders using different strategies — fundamentalists who trade toward fundamental value and chartists who follow price trends. Their interaction produces realistic market dynamics including volatility clustering and fat tails.

What is a market bubble?

A bubble occurs when asset prices rise far above fundamental value, sustained by expectations of further price increases rather than dividends or earnings. Behavioral models explain bubbles through overconfidence, herding, and positive feedback trading. Bubbles end when momentum reverses and fundamentalists dominate.

What causes fat-tailed return distributions?

Real asset returns have heavier tails than a normal distribution — large crashes and spikes are far more frequent. Behavioral models generate fat tails through regime switching between fundamentalist and chartist dominance, creating occasional extreme price movements.

What is the Efficient Market Hypothesis?

The Efficient Market Hypothesis (Fama, 1970) states that asset prices fully reflect all available information. Behavioral finance challenges EMH by documenting systematic mispricings attributable to psychological biases that persist because limits to arbitrage prevent rapid correction.

How does overconfidence affect markets?

Overconfident investors overestimate the precision of their information and trade more than they should. This increases trading volume, volatility, and mispricing. Studies show that individual investors who trade most frequently earn the worst net returns.

What is the disposition effect?

The disposition effect, arising from loss aversion and mental accounting, causes investors to sell winning investments too soon and hold losing investments too long. This is empirically well-documented and leads to suboptimal portfolio performance.

About this simulation

This simulation runs a heterogeneous-agent market where fundamentalists pull price toward a randomly drifting fundamental value while chartists chase recent momentum, amplified by a herding coefficient and skewed by loss aversion that overweights downward moves. Watch the green price line wander away from the dashed orange fundamental line into self-labelled BUBBLE or CRASH territory whenever mispricing crosses ±15%.

🔬 What it shows

A live price chart coloured green on up-ticks and red on down-ticks, a dashed orange fundamental-value line, a dotted grey anchor line, and a mispricing bar plus BUBBLE/CRASH flag that triggers once price departs far enough from fundamentals.

🎮 How to use

Set the fundamentalist/chartist population split, herding strength, loss-aversion coefficient λ, noise level, and anchor memory with the sliders, then click Run Market to start the animation; use Pause and Reset to freeze or restart the price path.

💡 Did you know?

The loss-aversion slider doesn't just make traders more cautious — in this model it literally multiplies chartist demand by λ whenever momentum is negative, so raising λ makes downward moves mechanically overreact compared to equivalent upward moves, reproducing the real-world pattern where crashes tend to be sharper than rallies.

Frequently asked questions

Why does the price sometimes drift far from the fundamental line and stay there?

When you raise the chartist share or herding strength, momentum-following demand can dominate the fundamentalist pull-back term, letting price wander in a self-reinforcing trend — this is exactly the bubble mechanism the model is built to demonstrate, and it only reverses once fundamentalist demand or a random shock turns the tide.

What triggers the BUBBLE or CRASH label on the canvas?

The simulation checks the mispricing percentage (price/fundamental − 1) every step and displays the label the moment that value exceeds +15% (bubble) or falls below −15% (crash) — the mispricing bar at the bottom of the canvas shows this percentage continuously so you can watch it approach the threshold.

Why does increasing loss aversion λ make crashes more dramatic than rallies?

The code multiplies chartist demand by λ specifically when momentum is negative, so a λ of 3 makes chartists react three times harder to a falling price than to an equivalent rise — asymmetric behaviour lifted straight from Kahneman and Tversky's prospect theory finding that losses hurt roughly twice as much as equivalent gains feel good.

What role does the anchor line play if it barely seems to move the price?

The anchor is a slowly updating average of past prices (controlled by the memory slider) that exerts a small pull on price independent of fundamentals or momentum — it's a weak, secondary force, but raising the anchor memory close to 0.99 makes it linger longer at old price levels, mimicking how investors anchor to stale reference points like 52-week highs.

Why does volatility (σ) in the stats panel change even when the noise slider is fixed?

The displayed volatility is measured from the last 10 realised log-returns of the simulated price, not read directly off the noise slider — herding and momentum effects amplify or dampen the raw noise input, so realised volatility clusters and spikes on its own, just as it does in real markets.