## Simulation parameters

Comparison mode
Equal budget isolates sample placement. Fixed cadence compares detection and observation cost against an independently chosen interval. Fixed cadence (minutes) The fixed monitor samples at this interval, plus the start and end of the window. Smaller values use more observations. Annual volatility (σ)
Annualised volatility. Higher values produce wider price swings and more barrier events. Annual drift (μ) Average annual return. Positive values tilt paths upward; negative values push them toward the lower barrier. Window (minutes) 1950 minutes is about five trading days. Longer windows tend to produce more events. Number of paths More paths give steadier aggregate results but take longer to render. Steps per path The fine simulation grid used as the reference history. More steps resolve shorter-lived crossings. Drop threshold (%) Percentage decline from the initial price that defines a lower-barrier event. Rise threshold (%) Percentage increase from the initial price that defines an upper-barrier event. Miss budget (ε)
Local diffusion-model design parameter. Lower ε produces denser adaptive sampling; it is not a global guarantee and does not cover jumps. Max interval cap (minutes) Leave empty for an automatic cap of window/15. Lower values force denser sampling everywhere. Detection deadline (grid steps) An event counts as detected only if a sample still lies beyond the barrier within this many reference-grid steps. RNG seed Leave empty for a new run, or enter a seed to reproduce and share the same paths. Include jumps (Merton jump-diffusion) Adds sudden moves that the diffusion-derived schedule cannot anticipate. Treat this as a model-risk stress test.

## Monte Carlo Sandbox

Running…

– events detected — adaptive ↓ lower · ↑ upper
– events detected — fixed ↓ lower · ↑ upper
– total samples matched path by path
– mean detection lag adaptive vs fixed · detected events only

The adaptive and fixed monitors receive the same number of samples on every path. The experiment therefore compares sample placement—not computational cost.

Running simulation…
How the Monte Carlo comparison works

1. Simulate: generate independent GBM or Merton jump-diffusion price paths on a fine grid.
2. Mark events: record each path's first lower- and upper-barrier crossing.
3. Allocate samples: adaptive intervals shrink near the closest barrier; the fixed monitor receives the same sample count, spaced uniformly.
4. Score: an event is detected when a sampled price remains beyond the barrier within the selected deadline.

The headline compares detections and mean lag under an equal sample budget. The miss budget ε is a local diffusion-model design parameter, not a global guarantee.

Raw result JSON

    {}

## How to read it

Open cyan circles
  Adaptive observations. The interval shrinks quadratically as the log-price approaches the nearer barrier.
Grey dots
  An equal-budget fixed sampler with the same number of observations on each path, spaced uniformly.
Red × and green ▲
  The first lower- and upper-barrier events on the fine reference grid.
Headline
  Same paths and the same sample budget. Compare how many events each schedule confirms before the deadline.

## Research demo caveat

The adaptive law is derived from a continuous diffusion model. Discrete grids, estimated volatility, latency, and jumps weaken any literal miss-probability guarantee.

## How this works

The app simulates price paths, marks first barrier crossings, and compares two observation schedules on exactly the same paths.

Adaptive intervals use a Brownian-bridge proxy and shrink with squared distance to the nearest barrier. Fixed observations are either equal-budget or independently spaced at a chosen cadence.

## Links

- pawelsarkowicz.xyz
- Adaptive Barrier Monitor repo
- License