3.5.21 · D1 · Physics › Guidance, Navigation & Control (GNC) › Kalman filter derivation — predict step, update step
Intuition Ek hi idea jo sab ke peeche hai
Ek Kalman filter kisi hidden quantity ke baare mein do numbers rakhta hai: uska best guess aur wo kitna unsure hai us guess ke baare mein. Parent page ka har symbol bas in do cheezón ka bookkeeping hai — guess aur doubt — jaise wo physics ke through push hote hain aur sensors se correct hote hain.
Is page mein assume kiya gaya hai ki aapko kuch nahi pata . parent topic mein predict/update equations touch karne se pehle, aapko symbols ki ek chhoti si pile mein fluent hona chahiye. Hum unhe ek-ek karke build karte hain, har ek ko ek picture se, har ek agla earn karta hai.
Sab kuch ek bump ke baare mein hai. "Guess with doubt" ko ek bell curve ke roop mein draw kiya jaata hai: peak aapke best guess par baiThi hoti hai, aur width batati hai ki aap kitne unsure hain. Narrow bump = confident. Wide bump = clueless.
Definition Ek number, ek vector, aur ek matrix har ek
asliyat mein kya hain
Scalar ek plain single number hota hai: 10 , − 3.2 , σ 2 . Picture: ek line par ek point.
Vector numbers ka ek stack hota hai jo ek saath kai cheezón ko describe karta hai. Picture: ek arrow, ya ek labelled column.
Matrix numbers ki ek grid hoti hai jo ek vector ko transform karke doosre mein badal deti hai. Picture: ek machine jisme arrow andar jaata hai aur (possibly rotated/stretched) arrow bahar aata hai.
Jo hidden cheez hame care karni hai woh hai state x . GNC mein yeh usually kai physical quantities ko bundle karta hai:
x = [ p v ] ⟸ position p and velocity v , stacked
Vector kyun, bas ek number kyun nahi?
Ek spacecraft ki state ek fact nahi hoti — woh position aur velocity aur attitude sab ek saath hota hai, aur woh ek doosre ko influence karte hain. Ek vector humein unhe saath carry karne deta hai aur ek matrix humein describe karne deta hai ki ek doosra kaise affect karta hai. Woh coupling hi poori wajah hai kyun ek Kalman filter running average se zyada kuch hota hai.
x k ka matlab hai "time step k par state". Woh chhota k ek clock tick hai: k − 1 pichla instant hai, k abhi hai, k + 1 agla hai. Hum State-space representation ko bilkul isi indexing se build karte hain.
Definition Truth vs. estimate
x (bina hat ke) = true state . Real, lekin hidden — aap ise directly kabhi read nahi kar sakte.
x ^ (hat ke saath) = uska aapka estimate — aapke bump ki peak.
x ^ ko "x-hat" bol ke paRhein. Hat ka matlab hamesha "mera best guess of" hota hai, kabhi "the truth" nahi.
Yeh distinction poore subject mein sabse zyada miss ki jaane wali idea hai. Har baar jab aap hat dekhein, yaad dilaiye khud ko: yeh ek belief hai, koi fact nahi.
Definition Variance = doubt ki squared width
Variance , σ 2 likhte hain, ek number hai jo measure karta hai ki bump kitni spread-out hai. BaDa σ 2 = wide bump = bahut unsure. ChhoTa σ 2 = narrow bump = confident.
Plain width σ (bina square ke) standard deviation hai — peak se ek typical distance. Hum ise square karte hain kyunki, jaise aap dekhenge, doubts cleanly combine hote hain jab squared hon.
Inverse variance kyun matter karta hai
Parent note do guesses ko fuse karta hai har ek ko 1/ σ 2 se weight karke. Woh quantity — variance ke upar ek — precision kehlaati hai. Precision hai "mera knowledge kitna sharp hai". Key fact: precisions add hoti hain jab aap independent information combine karte hain. Ek hi scene ki do blurry photos stacked karke ek sharper deti hain; wahi precision adding hai.
Ek number (σ 2 ) ek quantity ke baare mein doubt capture karta hai. Lekin x ek vector hai, isliye humein har entry ke baare mein doubt chahiye aur unke doubts kaise linked hain. Woh bookkeeping matrix P hai.
Definition Covariance matrix
P
P = E [ ( x − x ^ ) ( x − x ^ ) ⊤ ]
Diagonal entries har state component ki variances hain (position mein doubt, velocity mein doubt).
Off-diagonal entries covariances hain: ek component mein wrongness kaise doosre mein jaati hai.
Picture: 1-D bump ki jagah, "likely places" ki ek tilted ellipse jahan truth ho sakti hai. Diagonal = har axis ke saath size; off-diagonal = tilt.
Intuition Ellipse kyun tilt karti hai (Parent par Example 2)
Jab parent ko P − = [ 2 1 1 1 ] milta hai, woh off-diagonal 1 ka matlab hai ki ek velocity error leak karta hai ek future position error mein — do doubts correlated hain. Ellipse tilt karti hai. Full geometry ke liye Covariance matrices and Gaussian distributions ko iske saath paRhein.
Symbol E [ ⋅ ] ka matlab expectation hai — agar aap experiment ko forever repeat karte toh long-run average. Picture: noisy duniya ko ek million baar run karo, result average karo. E ka hamesha yahi matlab hota hai.
Superscript ⊤ (jaise A ⊤ mein) transpose hai: matrix ko uske diagonal ke upar flip karo, rows ko columns mein badlo. Picture: ek grid jo uski top-left-se-bottom-right line ke paas reflect hui ho. Humein ise isliye chahiye kyunki ek column times ek row ek poori grid build karta hai — bilkul woh outer product jo P ke andar hai.
w ∼ N ( 0 , Q ) paRhna
N Gaussian (bell-curve) distribution ko name karta hai.
Pehla slot mean hai (jahan peak baiThi ho): yahan 0 , matlab noise mein koi built-in bias nahi.
Doosra slot covariance hai (width): yahan Q .
∼ paRhte hain "is distributed as" — "w is drawn from this bell curve".
Parent par do noises aati hain:
w k ∼ N ( 0 , Q ) — process noise . Picture: chhote random jhaTke jo physics model predict karne mein fail karta hai (wind gusts, unmodelled forces). Q = woh jhaTke kitne baDe hain.
v k ∼ N ( 0 , R ) — measurement noise . Picture: sensor reading par jitter. R = sensor kitna shaky hai.
Q aur R ek hi tarah ki cheez hain."
Kyun sahi lagta hai: dono "noise covariances" hain, dono bump ko blur karte hain.
Fix: Q aapke model ko blur karta hai (predict mein use hota hai), R aapke sensor ko blur karta hai (update mein use hota hai). Unhe mix karna swap kar deta hai ki fusion ke kis side ko aap distrust karte hain.
Yeh teen matrices woh "machines" hain jo states, controls, aur measurements ko connect karti hain.
F = state-transition matrix : puraani state leti hai aur physics ko ek tick aage roll karti hai. Picture: "agar kuch surprise nahi kiya toh main next mein kahan hounga?" Constant velocity ke liye, F = [ 1 0 1 1 ] kehta hai new position = old position + old velocity·Δ t .
B u k = known control input : wo jo aapne deliberately kiya (thruster fire kiya). B command u k ko state par uske effect mein map karta hai.
H = observation matrix : ek state leti hai aur predict karti hai ki sensor ko kya read karna chahiye . Picture: "true world" units se "sensor" units mein ek translator. Agar sensor directly position read karta hai, H = [ 1 0 ] .
H ki zaroorat hi kyun hai
Sensors state ko rarely directly measure karte hain. GPS position deta hai lekin velocity nahi; rate gyro angular rate deta hai lekin angle nahi. H woh bridge hai jo humein ek full state estimate ko ek partial, unit-mismatched reading ke against compare karne deta hai. H ke bina, "measurement minus prediction" ek bewakoofana subtraction hoti. IMU and GPS sensor fusion dekho.
Definition Teen update characters
z k = actual number jo sensor ne is tick mein spat out kiya (measurement ).
y k = z k − H x ^ k − = innovation , ya "surprise": measurement minus jo humne predict kiya tha sensor kya kahega . Picture: us arrow ke beech gap jo aapne expect kiya tha aur us dot ke beech jo sensor ne diya.
K k = Kalman gain : ek number (ya matrix) "sensor ko ignore karo" aur "use poori tarah trust karo" ke beech, kehta hai surprise ka kitna hissa believe karna hai .
Intuition "Surprise" kyun, "error" kyun nahi
Aap measurement minus truth compute nahi kar sakte — truth hidden hai. Jo ek cheez aap actually subtract kar sakte hain woh hai measurement minus aapki prediction . Woh computable gap innovation hai, aur wahi ek correction signal hai jo filter kabhi dekhta hai.
Superscript minus, jaise x ^ k − aur P k − mein, ek prior mark karta hai — measurement fold in hone se pehle ("predicted, not yet corrected"). Bina minus ke = posterior , correction ke baad . Picture: minus = "coasting", bina-minus = "just snapped to the sensor".
Parent best gain dhundhta hai minimise karke doubt ko. Do tools woh karte hain:
Definition Derivative — slope tool
Derivative d x d ek point par ek curve ka slope measure karta hai. Picture: ek pahaaDi ki steepness aapke pair ke neeche. ek valley ke bottom par slope flat hota hai — zero. Isliye "differentiate and set to zero" ek minimum dhundhta hai.
Intuition Gain derivation mein calculus kyun aata hai
"Best estimate" ka matlab hai "least doubt". Doubt ek curve hai gain K ki function ke roop mein. Us curve ka sabse lowest point wahan hai jahan uski slope zero ho — isliye hum K ke saath respect mein derivative lete hain, use 0 set karte hain, aur solve karte hain. Woh ek move Kalman gain formula produce karta hai. Yeh wahi optimisation spirit hai jaise Recursive Least Squares .
Definition Trace — doubt ki ek matrix ko ek number mein badalna
Ek matrix P ko minimise karne ke liye humein shrink karne ke liye ek single number chahiye. Trace tr ( P ) diagonal ka sum hai — saare state components mein total variance. Picture: doubt-ellipse ki squared axis-lengths joDo. Trace shrink karna overall doubt shrink karta hai.
hat x-hat estimate vs truth
measurement z, innovation y
Jab yeh foundations solid ho jaayein, do baDe steps (predict, update) bas yahi machinery do baar apply karti hai: bump ko F ke saath aage push karo (Q se wider karo), phir K ke saath sensor ki taraf squeeze karo. Yahan se aap Extended Kalman Filter (EKF) aur Unscented Kalman Filter (UKF) par bhi chaRh sakte hain nonlinear worlds ke liye, sab Bayesian inference par resting.
Khud test karo — right side cover karo aur answer do:
x ^ mein hat ka matlab hamesha kya hota hai?Kisi quantity ka mera best estimate , kabhi true value nahi.
Variance σ 2 kya measure karta hai, ek picture ke roop mein? Belief bump ki squared width — baDa matlab unsure.
Precision kya hai aur uski kya special property hai? 1/ σ 2 ; independent estimates ki precisions add hoti hain.
P ke diagonal par kya hota hai vs. off-diagonal par?Diagonal = har component ki variance; off-diagonal = unke doubts kaise correlated hain (ellipse ka tilt).
w k ∼ N ( 0 , Q ) ko plain words mein paRhein.w k ek bell curve se draw kiya gaya hai jo zero par centred hai aur covariance (width) Q hai.
Q aur R mein kya difference hai?Q model/process noise hai (predict step); R sensor/measurement noise hai (update step).
Matrix F kya karta hai? State ko physics model use karke ek time step aage roll karta hai.
H ki zaroorat kyun hai?Yeh state ko un units/subset mein translate karta hai jo sensor actually report karta hai, taaki measurement aur prediction compare ki ja sake.
Innovation y k exactly kya hai? Measurement minus predicted measurement, z k − H x ^ k − — computable surprise.
Superscript minus (jaise P k − mein) kya signify karta hai? Ek prior — measurement fold in hone se pehle ki value.
Gain derivation mein derivative set to zero kyun use hoti hai? Woh K dhundhne ke liye jo total doubt minimise kare; ek curve ka minimum wahan hota hai jahan uski slope zero ho.
tr ( P ) kya represent karta hai?Saare state components mein total variance — woh single number jo hum minimise karte hain.