Kalman Filtering·Lecture 6 of 7
L6 · Noise Modeling and Diagnostics
시리즈: Kalman Filtering · 이전: L5 · 다음: L7
이 강의는 , , 를 model quantities로 해석하고 innovation으로 filter consistency를 검사하는 방법을 다룹니다. 단순히 estimate trajectory가 부드러운지만 보는 tuning을 피하는 것이 목표입니다.
형광펜: 정의·핵심 · 메커니즘·직관 · 조건·주의
목차
- 1. Q와 R의 정의
- 2. Physical disturbance에서 Q 만들기
- 3. Sensor data에서 R 추정하기
- 4. Initial covariance
- 5. Innovation sequence
- 6. Normalized innovation squared
- 7. Underconfidence와 overconfidence
- 8. Bias와 correlated noise
- 9. Outlier와 gating
- 10. Tuning workflow
1. Q와 R의 정의
표준 model에서
입니다. 두 matrices는 서로 다른 uncertainty source를 나타냅니다.
- : dynamics가 설명하지 못한 disturbance와 discretization error가 state에 남기는 uncertainty
- : state가 주어졌을 때 sensor measurement가 가지는 uncertainty
를 키우면 prediction covariance가 커지고 measurement correction이 상대적으로 강해지는 경향이 있습니다. 를 키우면 innovation covariance가 커져 measurement correction이 약해지는 경향이 있습니다. 그러나 이 반응은 결과이지 정의가 아닙니다.
먼저 physical error source에서 covariance를 만들고, 그다음 residual diagnostics로 model mismatch를 확인합니다.
2. Physical disturbance에서 Q 만들기
State가 position과 velocity인 constant-velocity model을 생각합니다.
한 sample 동안 acceleration 가 constant random variable이고
라고 model하면
따라서
반면 continuous-time white acceleration의 spectral density를 로 두고 exact discretization하면
두 식은 서로 다른 stochastic assumptions에서 나옵니다. Matrix 모양이 비슷하다는 이유로 variance와 spectral density를 같은 parameter로 취급하면 sampling interval을 바꿀 때 noise scale이 틀어집니다.
3. Sensor data에서 R 추정하기
State와 predicted measurement가 고정되어 있거나 별도의 ground truth로 알려진 조건에서 sensor samples 를 모으고 mean을 제거한 residual을
로 둡니다. Sample covariance는
입니다. 이 estimator의 표준 해석은 noise가 stationary하고 samples가 independent하다는 가정을 사용합니다. Temporal correlation이 있으면 같은 개가 제공하는 effective information이 줄고 uncertainty 평가도 달라집니다. 여러 axes 또는 sensors가 correlated이면 off-diagonal entries도 추정해야 합니다.
이 방법이 measurement model의 모든 error를 자동으로 분리하지는 않습니다. Ground truth error, temperature drift, vibration, timestamp error가 calibration data에 섞이면 의 의미도 함께 섞입니다. Bias는 covariance를 계산하기 전에 별도로 확인해야 합니다.
4. Initial covariance
는 initial estimation error에 대한 prior covariance입니다.
- State component를 직접 초기화했다면 해당 sensor uncertainty를 반영합니다.
- 알 수 없는 component는 물리적으로 가능한 범위를 covariance로 표현합니다.
- Cross-covariance를 알 근거가 없다면 으로 시작할 수 있지만, dynamics propagation이 이후 correlation을 만들 수 있습니다.
초기 error를 deterministic하게 크게 넣고 를 작게 두는 것은 filter에게 잘못된 confidence를 주는 test입니다. 초기 transient를 평가할 때는 true initial error가 가 표현한 distribution과 일치하는지도 확인해야 합니다.
5. Innovation sequence
Innovation은
이고 model이 맞다면
입니다. Standard linear-Gaussian assumptions 아래에서 innovation sequence는 시간에 대해 uncorrelated이며 Gaussian입니다.
따라서 residual plot에서 확인할 것은 다음입니다.
- mean이 근처인가?
- predicted 가 observed scale과 맞는가?
- 시간 autocorrelation이 남아 있는가?
- 특정 operating regime에서만 구조적인 pattern이 생기는가?
A consistent innovation fluctuates around zero without persistent structure; bias or model mismatch leaves a visible mean or temporal pattern.
6. Normalized innovation squared
Raw residual magnitude는 sensor units와 scale에 의존합니다. 이를 normalize한 statistic이 normalized innovation squared, NIS입니다.
Measurement dimension이 이고 assumptions가 맞다면
따라서 chosen significance level의 upper tail을 single-step gating에 사용할 수 있습니다. 또한 innovations가 서로 independent이고 매 step의 valid measurement dimension이 으로 일정하면 개를 모은 statistic은
를 따르므로 batch consistency interval을 만들 수 있습니다. Dimension이 변하면 degrees of freedom은 각 step의 valid dimensions를 합한 값입니다. Independence가 깨지면 이 batch reference distribution도 성립하지 않습니다. Code에서는 를 만들지 않고
를 계산합니다.
한두 sample이 interval 밖에 있는 것은 정상적으로도 발생합니다. 장기간의 exceedance rate와 time pattern을 함께 봐야 합니다.
7. Underconfidence와 overconfidence
여기서 confidence는 filter가 보고한 covariance의 크기를 뜻합니다.
| 상태 또는 test 문제 | 전형적인 NIS | 해석 후보 |
|---|---|---|
| overconfident | 지속적으로 큼 | 또는 과소평가, bias, model mismatch |
| underconfident | 지속적으로 작음 | 또는 과대평가 |
| independence 위반 | 인위적으로 작을 수 있음 | 같은 measurement 재사용, correlated residuals |
큰 NIS만 보고 를 키우는 것은 원인을 식별한 것이 아닙니다. 같은 현상은 sensor bias, wrong , delay, outlier에서도 생깁니다. 반대로 작은 NIS는 filter가 보수적일 수도 있지만, 같은 measurement를 independent evidence처럼 두 번 사용했을 때도 나타날 수 있습니다.
Innovation test는 문제가 있다는 증거를 줄 수 있지만, 와 중 어느 하나가 원인인지 단독으로 식별하지는 못합니다.
8. Bias와 correlated noise
Constant 또는 slowly varying bias가 있으면 innovation mean이 이 아니게 됩니다. Bias state 를 추가해
같은 random-walk model로 추정할 수 있습니다. 다만 augmented system이 observable인지 확인해야 합니다.
Temporal correlation이 남으면 white-noise assumption이 깨집니다. Low-pass filtered measurement를 원래 sensor sample과 독립인 것처럼 쓰거나, delay를 무시하거나, unmodeled dynamics가 있을 때 자주 나타납니다. 해결은 covariance inflation 하나가 아니라 correlation source를 state 또는 measurement model에 포함하는 것입니다.
9. Outlier와 gating
Outlier candidate는 NIS로 검사할 수 있습니다. Threshold 를 정해
이면 measurement를 reject하거나 robust update로 넘깁니다. Measurement를 reject한 step에서는
로 둡니다.
Gating은 model과 가 먼저 calibrated되어 있다는 전제가 필요합니다. Overconfident filter는 정상 measurement도 outlier로 reject할 수 있습니다. Rejection은 해당 step의 measurement-driven covariance reduction을 없앱니다. 이후 covariance가 커지는지는 dynamics와 에 달려 있으며 monotonic increase는 보장되지 않습니다. 어느 경우에도 rejection 자체가 bias를 제거하지는 않습니다.
10. Tuning workflow
- State와 measurement units, timestamp, frame convention을 먼저 검증합니다.
- Sensor calibration data로 bias와 의 초기값을 구합니다.
- Physical disturbance model과 discretization으로 의 구조를 만듭니다.
- Initial uncertainty에 근거해 를 정합니다.
- Simulation에서 known truth와 estimation error를 비교합니다.
- Hardware data에서 innovation mean, scale, autocorrelation, NIS를 기록합니다.
- Structured residual이 보이면 model을 먼저 수정합니다.
- 남은 mismatch에 대해서만 covariance parameters를 조정합니다.
Trajectory가 부드럽다는 사실은 consistency를 보장하지 않습니다. Estimate와 reported covariance가 함께 맞는지를 innovation statistics로 검사해야 합니다.
이해 확인
1. Sampled constant acceleration model과 continuous white acceleration model의 가 다른 이유를 설명하시오.
2. Innovation sequence가 지속적인 positive mean을 가질 때 가능한 원인을 두 가지 쓰시오.
3. Measurement dimension이 일 때 NIS가 따르는 기준 distribution을 쓰시오.
4. NIS가 지속적으로 크다는 사실만으로 가 작다고 단정할 수 없는 이유를 설명하시오.
답
1. 하나는 sample 동안 constant인 random acceleration을 가정하고, 다른 하나는 continuous-time white process의 spectral density를 적분합니다. Stochastic assumptions와 sampling scaling이 다릅니다. → §2
2. Sensor bias, wrong measurement model, timestamp delay, unmodeled dynamics 등이 가능합니다. → §5 · §8
3. Linear-Gaussian model과 correct covariance assumptions 아래에서 입니다. → §6
4. 큰 NIS는 · 과소평가뿐 아니라 bias, outlier, wrong , delay 같은 여러 model errors에서도 생기므로 원인이 식별되지 않습니다. → §7