# Lecture 13: Kalman Filters - University of Texas at Austin

Lecture 11: Kalman Filters CS 344R: Robotics Benjamin Kuipers Up To Higher Dimensions Our previous Kalman Filter discussion was of a simple one-dimensional model. Now we go up to higher dimensions: n x State vector: m Sense vector: z l Motor vector: u First, a little statistics.

Expectations Let x be a random variable. The expected value E[x] is the mean: E[x] = N 1 x p(x) dx x = x i N 1 The probability-weighted mean of all possible values. The sample mean approaches it. Expected value of a vector x is by T component. E[x] =x =[x1,L xn ]

Variance and Covariance The variance is E[ (x-E[x])2 ] N 1 2 =E[(xx) 2] = (xi x) 2 N 1 Covariance matrix is E[ (x-E[x])(x-E[x])T ] N 1 Cij = (xik xi )(xjk x j ) N k=1 Divide by N1 to make the sample variance an unbiased estimator for the population variance. Biased and Unbiased Estimators Strictly speaking, the sample variance N 1 2 2

2 =E[(xx) ] = (xi x) N 1 is a biased estimate of the population variance. An unbiased estimator is: N 1 2 2 s = (x i x ) N 1 1 But: If the difference between N and N1 ever matters to you, then you are probably up to no good anyway

[Press, et al] Covariance Matrix Along the diagonal, Cii are variances. Off-diagonal Cij are essentially correlations. C1,1 = 12 C2,1 CN ,1 C1,2 2 C2,2 = 2

M 2 CN ,N = N C1,N O L Independent Variation x and y are Gaussian random variables (N=100) Generated with x=1 y=3 Covariance matrix: 0.90 0.44 Cxy = 0.44 8.82

Dependent Variation c and d are random variables. Generated with c=x+y d=x-y Covariance matrix: 10.62 7.93 Ccd = 7.93 8.84 Discrete Kalman Filter n Estimate the state x of a linear stochastic difference equation xk =Axk1 +Buk +wk1 process noise w is drawn from N(0,Q), with covariance matrix Q.

with a measurement zm zk =Hxk +vk measurement noise v is drawn from N(0,R), with covariance matrix R. A, Q are nxn. B is nxl. R is mxm. H is mxn. Estimates and Errors n xk is the estimated state at time-step k. n xk after prediction, before observation. e

=x x Errors: k k k k ek =xk x Error covariance matrices: T k k k P =E[e e ] T k

Pk =E[ek e ] k Pk Kalman Filters task is to update x Time Update (Predictor) Update expected value of x k1 +Buk xk =Ax Update error covariance matrix P T Pk =APk1A +Q Previous statements were simplified versions of the same idea: 3 3

(t ) =x (t2) +u[t3 t2] x 2 2 2 (t ) = (t2) + [t3 t2 ] Measurement Update (Corrector) Update expected value k k

k =x +K k(zk Hx ) x k innovation is zk Hx Update error covariance matrix k Pk =(IK kH)P Compare with previous form 3 3

(t3) =x (t ) +K(t3)(z3 x (t )) x 2 2 (t3) =(1K(t3)) (t3 ) The Kalman Gain The optimal Kalman gain Kk is T T 1 K k =Pk H (HPk H +R) T k T k PH =

HP H +R Compare with previous form 2 (t3 ) K (t3) = 2 2 (t3 ) + 3 Extended Kalman Filter Suppose the state-evolution and measurement equations are non-linear: xk =f (xk1,uk ) +wk1 zk =h(xk) +vk process noise w is drawn from N(0,Q), with covariance matrix Q. measurement noise v is drawn from N(0,R), with covariance matrix R. The Jacobian Matrix

For a scalar function y=f(x), y = f (x)x For a vector function y=f(x), f1 y1 (x) L x1 y =J x = M = M f yn n (x) L x1 f1 (x) xn x1 M M fn xn (x)

xn Linearize the Non-Linear Let A be the Jacobian of f with respect to x. fi A ij = (xk1,uk) x j Let H be the Jacobian of h with respect to x. hi Hij = (xk) x j Then the Kalman Filter equations are almost the same as before! EKF Update Equations Predictor step:

k1,uk ) xk =f (x k T P =APk1A +Q k T k T

1 Kalman gain: K k =P H (HP H +R) Corrector step: k k k =x +K k(zk h(x )) x k Pk =(IK kH)P Catch The Ball Assignment

State evolution is linear (almost). What is A? B=0. Sensor equation is non-linear. What is y=h(x)? What is the Jacobian H(x) of h with respect to x? Errors are treated as additive. Is this OK? What are the covariance matrices Q and R? TTD Intuitive explanations for APAT and HPHT in the update equations.

## Recently Viewed Presentations

• Hold fast to dreamsFor if dreams dieLife is a broken-winged birdThat cannot fly.Hold fast to dreamsFor when dreams goLife is a barren fieldFrozen with snow. My Papa's Waltz. The whiskey on your breath ...
• Available in downloadable TBX files on Open Data Portal (12,371 downloads as of 1/4/2015, stats retrieved on 23.4.2015) Inserted in several search engines and plug-ins. ... Ask TermCoord for an external ECAS account. IATE Projects with Universities. IATE. TermCoord inserts...
• Deinococcus (SEM) House ant. Avian influenza . virus. Human eyelash. Yeast. Using Microscopes to Visualize the Three Shapes of Bacteria. Cocci (round) Bacilli (rod) Spirilla (spiral) Light microscope: Three shapes of bacteria . taken with an SEM. Bacilli. Cocci. Spirilla.
• Displays exceedance of 100-yr recurrence interval and fractional percentages. Phase 2 . IOC. Available via software collaboration portal (SCP) Still needs to have colors calibrated to probability values. We want to make sure we are appropriately signalling risk.
• ACCIDENT DATA REPORT - BALESET ADATJELENTÉS 2250 kg feletti légijárművet ért baleset esetén a szakmai vizsgálat lezárását követően a lehető legrövidebb időn belül. ... (ek) hozzátartozói, a baleset sérültjei - Média ÉRTESÍTÉSEK 2005. évi CLXXXIV. törvény 15. § (2) A...
• Online Solution for Small Shop. Supervisor:Phan Truong Lam TEAM MEMBERS: Le Huy. Bui DucManh. Le ThanhHai. Pham Van Nguyen. Nguyen Dinh Dong
• The proposition is the foundation of the entire structure of the sermon. The proposition will accurately express the main thought of the sermon. It clearly indicates to the congregation the course of the sermon. Types of Propositions! 1. The form...
• The virus is a mixing of four known strains of influenza A virus: one endemic in humans, one endemic in birds, and two endemic in pigs (swine). Transmission of the new strain is typically human-to-human; eating cooked pork products will...