当前位置:网站首页>From Bayesian filter to Kalman filter (zero)
From Bayesian filter to Kalman filter (zero)
2022-07-28 19:09:00 【Learn something】
What is filtering ?
Whether it is the data inferred from the established model equation , Or use the data directly measured by the sensor , It's not always an ideal fitting curve , There are always deviations 、 variance , And filtering is to reduce these variances as much as possible , Reduce noise interference , So that the final data is closer to the real value —— That is, the variance tends to 0. therefore , Filtering is reducing variance .
How to understand that every moment is a random variable ?
We know , We need to take samples , There is a sampling interval , In fact, we cannot determine the value of each sampling point , It can only be regarded as a random variable
The simple principle of Bayesian filtering ?
Subjective probability + External observation = Relatively objective probability
Subjective probability : People's subjective guesses or people based on certain knowledge 、 Empirical equations and models , Used to predict the next data value
External observation : Data measured with actual sensors
Relatively objective probability : For subjective probability , Always seem unsure , The variance is relatively large ( After all, it's speculation ), When there is a reference to external observations , People will combine these external observations to correct the previous subjective probability , So it seems relatively objective
such as : In the stock market , At first , Subjectively think that the stock market of a is good , Think it will soar next . This is the initial subjective judgment , There is no external observation 、 Subjective judgment before the experiment . But next , I learned from the news , A stock owner ran away , That is, with external observation 、 experiment , Then it's time to correct the previous subjective judgment , Corrected , I think the stock of a is likely to fall next . This becomes a relatively objective judgment . In fact, the above is the fusion of subjective judgment and external observation information , So as to get a more comprehensive and objective result ; Or use external observation ( Additional information ) To correct your initial subjective judgment , So that the model 、 The judgment is closer to the real situation .
The value of each moment is a random variable , Whether there is a connection between these random variables ?
Existing connection , You can do recursion , But you need to guess the specific recursive relationship yourself 、 To fit , in other words , Based on the truth value of the previous time and the established recursive relationship , It is easy to infer the value of the current moment . This recursive relationship between the current time value and the previous time value is called the equation of state —— seeing the name of a thing one thinks of its function , The reaction is at different times / The relationship between States , So as to realize recursion and prediction . But apparently , There must be errors in recurrence ( variance ) Of , After all, there is no equation 、 The model can be said to be 100% accurate , Because it's hard for you to find this equation that fits these data perfectly , It's impossible to guess so accurately , Unless you know in advance the equation of the signal you want to measure .
for example , Recurrence relation ( among Q It's a noise signal , Normally distributed noise )

Whether there is a certain relationship between the true value and the value measured by the sensor ?
There can be . Think so , If a sensor has high measurement accuracy, there is no error , Then each measured value = Truth value , This is the functional relationship between them . however , There are usually errors , And the units of your observations and measurements are not necessarily the same , Therefore, it is necessary to use relational expression to describe the relationship between —— The equation used to describe the relationship between the observed value and the true value is called the observation equation . obviously , Here, the truth value can be inversely evaluated through the observation value and observation equation , however , The result of this reverse calculation must have errors , After all, the data you observe are actually inaccurate ( Sensor accuracy leads to ).
for example , The observation equation (R It's noise 、 error )

Why introduce the equation of state and observation equation ?
Through the equation of state , Once we know the initial value x0, Then we can use the equation of state to predict the next true value x1, x2, x3...... wait
By observing the equation , Plus the data measured by the sensor , We can reverse the truth value x1, x2, x3...... wait
however , Which of these two do you want to believe ? The answer is , I want all of them. —— Fuse the data of the two , Reduce variance and uncertainty , So as to get a more accurate value , Closer to the truth
This initial value x0 How did you get ? What do you usually need to know about the initial value ?
initial value x0 In fact, it can be determined arbitrarily , Because even if the initial value is outrageous at first , But because there are observations to correct , So it will be corrected to the normal level soon
About the initial value , We need to understand , The value of each moment is actually a random variable , Since it is a random variable , Then there will be mean and variance , therefore , Requirements for initial values : You need to know the mean value of the initial value ( In fact, the mean value can be regarded as the true value , After all, the mean value is actually the weighted result after considering the probability of various situations , Equivalent to the optimal result ) And variance . alike , This variance is also set by oneself , If you feel confident about your average , Then the variance can be reduced ; On the contrary, it is a little bigger . Small variance , The explanation is quite believable , Then the average value accounts for a larger proportion in the fusion result .
Why does the initial value need to know the variance ?
This depends on the equation of state ( That is, the recursive relationship between each random variable ). Or is it because the model can't predict the value completely accurately . Actually , Here we can regard the model as a “ Measuring instrument ”—— It infers the next result from the previous result . Since it is “ Measuring instrument ”, There must be measurement error , This measurement error is described by variance , Knowing this variance is actually equivalent to knowing its probability distribution ( For normal distribution , Most of them are normal distribution )
The additional variance at each time in the equation of state Q Are they the same? ,“ Accuracy of measuring instruments ” It should remain unchanged ?
Actually, that's because Q For the covariance matrix when there are multiple state values , It describes the noise variance corresponding to each state value , And the noise between different state values is uncorrelated, that is, the covariance is 0, Only yourself and your covariance ( Variance ) Not for 0 And it remains the same , thus , actually Q It's a diagonal matrix . for example , Suppose we have two states —— Displacement and velocity , So how to write the equation of state ?( Coefficients and variances are randomly selected , Just to illustrate )
Mean recurrence :

Recurrence between variances (p Variance ):

In fact, it is the equation of state in modern control theory , Generally, the mean and variance are treated separately
The variance added at each time in the observation equation R Are they the same? ,“ The measuring accuracy of the instrument ” It should remain unchanged ?
Yes , and Q The matrix is similar to ,R A matrix is also a diagonal matrix , It's a covariance matrix , The measurement error for a certain state type value remains unchanged
Let's write this first , I don't think I'm clear enough , We need to take a closer look . Especially Bayesian derivation , It's a little complicated. , But once the Bayesian formula is clear , Kalman filter should soon understand
边栏推荐
- When unity customizes the editor, let the subclass inherit the inspector display effect of the parent class
- MySQL date function
- Mongodb initialization
- Zero knowledge proof: zkp with DDH assumption
- If you want to learn software testing, where can you learn zero foundation?
- Remember a uniapp experience
- 什么样的知识付费系统功能,更有利于平台与讲师发展?
- 3、 Uni app fixed or direct to a certain page
- 关于ASM冗余问题
- Unity 之 切换语言导致报错:System.FormatException:String was not recognized as a valid DateTime.
猜你喜欢

Special Lecture 6 tree DP learning experience (long-term update)

真正的 HTAP 对用户和开发者意味着什么?

现代化个人博客系统 ModStartBlog v5.4.0 登录界面改版,新增联系方式

The ever-changing pointer ----- C language

UE4.25 Slate源码解读

4、 Interface requests data to update input information interactively

Decimal to binary advanced version (can convert negative numbers and boundary values)

Why app uses JSON protocol to interact with server: serialization related knowledge

【图像隐藏】基于DCT、DWT、LHA、LSB的数字图像信息隐藏系统含各类攻击和性能参数附matlab代码

6-20漏洞利用-proftpd测试
随机推荐
How to write a JMeter script common to the test team
SwiftUI 组件之如何实现电话号码掩码隐藏部分的文本字段TextField(教程含源码)
kotlin:out in
If you want to change to it, does it really matter if you don't have a major?
Pytorch GPU yolov5 reports an error
A priori, a posteriori, likelihood
Is there any prospect and way out for software testing?
Two month software testing training scam? How to choose training institutions?
JVM tuning
[GXYCTF2019]StrongestMind
Overview and working principle of single chip microcomputer crystal oscillator
Mongodb database shell command execution
Four years later, Debian finally recaptured the "debian.community" domain name!
Getting started with gateway
What if the content of software testing is too simple?
How big is it suitable for learning software testing?
Kotlin:sealed Class detailed explanation of sealed class
ECS 5 workflow
PyG搭建异质图注意力网络HAN实现DBLP节点预测
N32替换STM32,这些细节别忽略!