Home / Science / Engineering / Control and robotics / Kalman filter playgroundTool #639

Kalman filter playground: tune Q and R on a noisy sensor and see the estimate, innovations and covariance

Try a Kalman filter in your browser. Simulate a noisy sensor with a repeatable seed or paste your own measurements, pick a constant-level or constant-velocity model, move the Q and R sliders, and watch the estimate against the truth, the innovations, the uncertainty and the gain. Download every step as CSV.

Keep it one tap away for everyday use.

Bookmark Kalman filter playground?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Measure
  2. Q and R
  3. Estimate
  4. Check
Nothing is uploadedWorks offline once open

Measurements

The same seed always gives the same noise, so you can change Q and R and compare fairly. For the constant model the true value takes random steps of variance q·Δt; for constant velocity it is pushed by random acceleration with spectral density q.

Filter settings

Small Q or large R: a smooth estimate that is slow to follow changes. Large Q or small R: a quick estimate that copies the noise. The filter starts at the first measurement (variance R) with velocity 0.

Result

Estimate

Innovation (measurement minus prediction)

Uncertainty and gain

Download

What it does

A Kalman filter combines a model of how something moves with noisy measurements of it, and gives the best estimate it can at each step, together with how sure it is. It is used everywhere from phone GPS to aircraft autopilots. This page lets you see how it behaves.

  • Two models: a constant level (the value wanders slowly, a random walk) or constant velocity (the value moves at a speed that changes slowly). The constant-velocity filter also estimates the speed.
  • Two kinds of data: a simulated sensor with a known truth and a random seed, so the same noise comes back every time, or your own measurements (time and value, and optionally the true value).
  • Two knobs: Q, how much the filter expects the state to wander between steps, and R, the variance of the sensor noise.

How to use it

  1. Leave Simulate a noisy sensor selected, or switch to My own measurements and paste or open a file.
  2. Move the Q and R sliders, or type values in the boxes. The sliders cover a wide range on a log scale.
  3. Watch the estimate chart: grey truth, open circles for the measurements, the estimate and its ± 2σ band.
  4. Check the innovations (each measurement minus what the filter predicted). For a well-tuned filter they look like random noise and about 95 % fall inside the ± 2√S band.
  5. Press Set Q and R to the true values to see the filter tuned to the simulation, or New noise for a fresh seed.

What the numbers mean

  • Mean normalised innovation² (NIS) should be close to 1. Well above 1 means the filter trusts its model or the sensor too much; well below 1 means it is too cautious.
  • Gain K is the share of each surprise that goes into the estimate. It settles to a steady value when Q, R and the time step stay the same; the constant model shows that steady-state gain.
  • RMS error against the truth shows how much the filter improved on the raw sensor.

Worked example

The default simulation has 100 steps of 0.5 s, a true process noise of 0.05, sensor noise σ = 2 and seed 1, with the constant-velocity model and Q = 0.05, R = 4 (the true values). The page shows RMS error 0.946 filtered against 2.02 raw: the filter more than halves the error. The mean NIS is 0.988, 99 % of the truth lies inside the ± 2σ band, and the last velocity estimate is 2.02 ± 0.815 per second. Raise Q to 5 and the estimate follows the noise more, so the RMS error rises to 1.41. Drop R to 0.1 and the filter is badly overconfident: NIS jumps to 33.

FAQ

How do I choose R? Measure the sensor noise: hold the quantity still and take the variance of the readings. R is that variance (σ²), not σ.

How do I choose Q? It is harder: it describes how much the real thing changes that the model does not explain. Start small, then raise it until the innovations look like noise and NIS is near 1.

Are my measurements sent anywhere? No. Everything runs in your browser, and nothing is stored.

Where the numbers come from

  • Kalman filter equations (predict x = Fx, P = FPFᵀ + Q; update K = PHᵀ(HPHᵀ + R)⁻¹, x += K(z − Hx), P = (I − KH)P): Kalman (1960) and standard estimation texts.
  • Constant-velocity process noise for white acceleration of spectral density q: Q = q·[[Δt³/3, Δt²/2], [Δt²/2, Δt]], standard tracking practice.
  • Normalised innovation squared as a consistency check: standard estimation practice.
  • Simulated data come from fibub's own seeded random number generator; the example table is made up.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Trend and anomaly analyser #138 Paste or open a time series (yearly, monthly or any steps) and test for a trend with Mann-Kendall, the Hamed-Rao autocorrelation correction or the seasonal test, get Sen's slope with its confidence interval, a Pettitt change point and anomalies from a baseline period. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check. Path planning visualiser #640 Draw walls on a grid with a tap or a drag, then watch A* or Dijkstra (4 or 8 directions) find the shortest path and which cells they search, or grow a seeded RRT tree through open space. Shows path length, cells expanded and tree size, and downloads the path as CSV. D-H forward kinematics #635 Type a robot arm's Denavit-Hartenberg table (standard or modified convention), move the joints with sliders and get every link transform, the end-effector position and orientation (roll, pitch, yaw, quaternion), the Jacobian and a 3D picture you can turn. Nothing is uploaded. PID tuning simulator #636 Pick a plant (first or second order, or any transfer function) with dead time, set the PID gains with sliders and see the closed-loop step response with rise time, overshoot, settling time and steady-state error, the controller output, the Bode plot with gain and phase margins, and Ziegler-Nichols starting values. Nothing is uploaded. Inverse kinematics for 2 and 3 link arms #637 Find the joint angles that put a planar 2-link arm's tip, or a 3-link arm's tool at a given angle, on a target point. Both elbow-up and elbow-down solutions, a reach check that says why a point is out of reach, optional joint limits, a drawing of the arm and its workspace, and a batch of targets to CSV.