Exercises — Kalman filter derivation — predict step, update step
3.5.21 · D4· Physics › Guidance, Navigation & Control (GNC) › Kalman filter derivation — predict step, update step
Un paanch equations ki reminder jo tum use karoge (sab parent mein define hain):
Level 1 — Recognition
Exercise 1.1
Apne words mein batao ki paanch filter equations mein se har ek kya karti hai. Kaun si do predict mein hain aur kaun si teen update mein?
Recall Solution
- — predict mean: estimate ko physics ke through aage coast karo, plus kisi bhi known command ka effect.
- — predict covariance: uncertainty ko propagate karo aur se badhao.
- — innovation: measurement minus jo measure hone ki humein expectation thi.
- — gain: optimal blend weight, prior-uncertainty over total-uncertainty.
- aur — update mean & covariance: estimate ko correct karo aur uncertainty ko ghataao. Pehli do = predict; aakhri teen (innovation + gain + correction) = update.
Exercise 1.2
1-D scalar filter, . Prior , measurement noise . Innovation covariance compute karo.
Recall Solution
. Kyun: surprise ki total uncertainty hai: sensor ke through dekhi gayi prior uncertainty () plus sensor ka apna noise ().
Exercise 1.3
Same numbers (, , ). Gain compute karo. Kya yeh se bada hai ya chhota, aur yeh tumhe kya batata hai?
Recall Solution
. : prior zyada uncertain hai () sensor se (), isliye hum measurement ki taraf jhuk rahe hain. Bilkul equally-trusted case mein exactly milta.
Level 2 — Application
Exercise 2.1
1-D constant-position filter. Prior , . Measurement , , . Ek full update run karo: , , , , nikalo.
Recall Solution
- .
- .
- .
- .
- . Padho: hum zyaatar ki taraf move kar gaye (gain ) aur uncertainty se tak gir gayi — measuring ne humein confidence diya.
Exercise 2.2
Do-step predict only, constant velocity, , , (koi command nahi), . Shuru karo , se. Ek baar predict karo, phir dobara. Har ek ke baad aur do.
Recall Solution
Step 1 mean: . Step 1 covariance: . Pehle , phir se multiply: Step 2 mean: . Step 2 covariance: ke saath, , se multiply: (Dhyan se: ki row 1 hai ; ke columns se dot karne par aur milta hai. Row 2 hai : aur .) Kyun badhti hai? ke saath model "perfect" hai, phir bhi uncertainty badhti hai: uncertain velocity position ko corrupt karti rehti hai, aur position variance (top-left) har step badhti hai.
Exercise 2.3
Gain ke "collapse" limits dikhao. Scalar ke liye: par kya hai? par? Aur par? Har case mein resulting do.
Recall Solution
.
- (perfect sensor): , isliye . Measurement ko poora adopt karo.
- (perfect prior): , isliye . Measurement ignore karo.
- (useless, infinitely noisy sensor): , isliye phir aur . Measurement discard ho jaati hai aur uncertainty shrink nahi hoti — ek garbage reading sahi taur par kuch nahi badlati. Yeh teen cases woh anchors hain jis beech har gain rehta hai: , aur ke beech ride karta hai, prior aur sensor uncertainty ke ratio se driven.
Level 3 — Analysis
Exercise 3.1
Ek scalar constant-position filter ke liye no process noise (), , constant ke saath, prove karo ki posterior variance recursion follow karta hai (precisions add hote hain). Phir prior se shuru karke identical measurements ke baad nikalo.
Recall Solution
Constant position, ⇒ predict kuch nahi karta: . Update: , aur . Reciprocal lo: . ∎ steps ke baad: har measurement precision mein add karta hai, isliye , jo deta hai Padho: bilkul samples average karne jaisa — variance ki tarah girta hai jab prior overwhelm ho jaata hai. Seedha Recursive Least Squares se connect hota hai.
Exercise 3.2
Numeric: prior , , , constant position. Ex 3.1 use karke, compute karo (teen measurements). Phir argue karo kyun aur isme kaun sa real-world danger chhupta hai.
Recall Solution
. Jaise , : filter infinitely confident ho jaata hai. Danger: ke saath gain , isliye filter nayi data sunna band kar deta hai. Agar sach mein state drift kare (real life mein hoti hai), filter react nahi kar sakta — filter divergence. Isliye real filters rakhte hain.
Exercise 3.3 — figure
Ek scalar update prior ko measurement likelihood ke saath fuse karta hai. Predict karo ki posterior mean kahan hogi ( ke paas ya ke paas?) aur kya uska peak dono se uuncha hoga. Phir confirm karne ke liye aur compute karo.

Recall Solution
Picture se prediction: measurement bahut sharper hai (variance vs ), isliye posterior ke paas honi chahiye aur dono se uunchi/narrow honi chahiye. Compute karo: ; ; . sach mein ke paas hai, aur — dono inputs se narrow. Figure description (greyscale-safe): "density vs state " plot par teen bell curves. par centred ek wide, short bell prior hai. par centred ek narrow, tall bell measurement hai. Tallest, narrowest bell, par centred (dono ke beech par sharp measurement ki taraf jhuka hua), posterior hai — visually confirm karta hai ki confident input dominate karti hai aur fused peak dono ko beat karta hai.
Level 4 — Synthesis
Exercise 4.1
Full predict + update cycle, constant velocity. , , . Hum sirf position measure karte hain: , . Start , se. Ek predict ke baad position measurement aati hai. compute karo.
Recall Solution
Predict mean: . Predict cov: (parent Example 2 jaisa). Innovation: , isliye . : . Yahan , isliye . Gain: . (pehla column), isliye . Corrected mean: . Covariance: . Yahan , isliye ; se multiply karne par: Jaadu yeh hai: humne sirf position measure ki, phir bhi velocity estimate bhi badli () aur uski variance bhi giri (). Predict step ki off-diagonal correlation ne position measurement ko velocity inform karne diya. Yeh choti si IMU and GPS sensor fusion hai.
Exercise 4.2
Verify karo ki Joseph form wahi deta hai jo short form deta hai jab optimal ho, Ex 2.1 ke scalar numbers use karke ().
Recall Solution
Short form: . Joseph: . ✔ Dono agree karte hain kyunki optimal gain hai; cross-terms exactly cancel ho jaati hain. Kisi bhi non-optimal ke liye yeh differ karte, aur sirf Joseph correct rehta.
Level 5 — Mastery
Exercise 5.1
Ek designer ne constant-position filter ke liye set kiya aur hairan hai ki kai GPS fixes ke baad estimate dheere-dheere drift karne wali sach mein position ko track karna band kar deti hai. Apne Ex 3.1/3.2 results use karke, mechanism precisely explain karo aur sabse chhota fix propose karo.
Recall Solution
Mechanism: ke saath, . Phir , isliye : incoming measurements ko near-zero se multiply kiya jaata hai aur ignore kar diya jaata hai. Filter ek purani value ke baare mein certain ho jaata hai — divergence. Fix: set karo. Yeh har predict step par mein ek floor add karta hai, ko tak collapse hone se rokta hai, isliye filter drift ke liye responsive rehta hai. encode karta hai "model thoda galat ho sakta hai" — bilkul woh humility jo real system ko chahiye. (Formally yeh Bayesian inference se connect hota hai: har step prior ko re-inflate karta hai.)
Exercise 5.2
Process noise ke saath scalar constant-position filter ka steady state. Predict hai ; update hai jahan . Steady state par constant hai. ke liye fixed point nikalo.
Recall Solution
Combine karo: , phir . Steady state par mano: Multiply out karo: ke saath: . Padho: case () ke unlike, yahan ek positive constant par settle hoti hai. Filter ek stable, non-zero confidence par pohonchta hai — bilkul wahi jo ise zinda aur tracking rakhta hai.
Exercise 5.3 — figure
Sketch karo/argue karo ki scalar gain time ke saath bade initial se steady state tak (Ex 5.2 setup) kaise evolve karta hai. Kya monotone hai? Kahan settle karta hai?

Recall Solution
Bada shuru karo: bada ⇒ pehla ke paas (andha rehte waqt sensor par near-fully trust karo). Jaise measurements aati hain, ki taraf girta hai, isliye girta hai aur par settle karta hai jahan , jo deta hai . Figure description (greyscale-safe): "gain vs update step " plot. ke liye main curve (circles) ke paas uunchi shuru hoti hai, pehle kuch steps mein teezi se girti hai, phir ek horizontal dotted line par flat ho jaati hai — monotone decreasing, positive floor tak, kabhi nahi pohonchti. ke liye ek doosra dashed curve (squares) ki taraf sagging rehta hai, jo dead, unresponsive filter illustrate karta hai. Positive floor ka gift hai.