Trading Dev AcademyFree quant education

Free lesson · Stochastic calc

Start with one random step before continuous noise

Open interactive lessonPractice calculationsExplore labs

Start with the idea

  • A random variable has several possible values.
  • Calculate its average and spread before introducing a random path.
Symbols, units & horizon
  • Z: dimensionless toy shock, equally likely −1 or +1
  • a: a fixed multiplier in the scaling rule
  • h: positive elapsed time in days
  • σ: shock scale in units per square root of day
  • ΔX: random change in units
  • E: probability-weighted mean
  • Var: mean squared deviation from the mean

When and why to use this

Use this scaling as preparation for simulation increments. The next lesson replaces the toy shock with the Gaussian increments of Brownian motion.

  • Toy shock Z: either −1 or +1, each with probability one half.
  • Mean E[Z]=0: positive and negative outcomes balance.
  • Variance Var⁡(Z)=1: squared deviations are both 1.
  • Multiplying a shock by a scales its standard deviation by |a|.
  • This two-outcome model teaches scaling. It is not a Gaussian Brownian increment.
ΔX=σhZ,E[ΔX]=0,Var⁡(ΔX)=σ2h
Core rule · definition and worked arithmetic

Start with one random step before continuous noise

  1. The two changes are −σh and +σh. Equal probabilities give mean zero.
  2. Square each deviation: both give σ2h. Their weighted average is therefore σ2h.
  3. Standard deviation is the square root of variance: σh for nonnegative σ.
Work it by hand

With σ=2 units/√day and h=.25 day, the change is −1 or +1 unit. Mean=0, variance=1 unit², standard deviation=1 unit.

Use the rule

  • Name the inputs and units.
  • Work the small example by hand.
  • Check the result before continuing to the next lesson.

Before moving on

Explain the core rule in one sentence, reproduce the worked calculation and solve both practice variations.

Research sources, review dates and limitations

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

from math import sqrt

def toy_shock(scale, elapsed, sign):
    if scale < 0 or elapsed <= 0 or sign not in (-1,1):
        raise ValueError("Nonnegative scale, positive time and sign +/-1 required")
    return scale*sqrt(elapsed)*sign

print(toy_shock(2,.25,-1), toy_shock(2,.25,1))

Continue learning

Stochastic Calculus — all lessons
  1. Start with one random step before continuous noise
  2. Before Itô: random walks, Brownian motion and information
  3. Itô integration and quadratic variation
  4. SDEs, Euler–Maruyama and an Ornstein–Uhlenbeck example
  5. Geometric Brownian motion: the model under Black–Scholes
  6. Itô's lemma: why gamma exists
  7. Black–Scholes and delta hedging in production
  8. Put–call parity and a full Greek P&L budget

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations