文件名称:
Kalman_and_Bayesian_Filters_in_Python.pdf
开发工具:
文件大小: 12mb
下载次数: 0
上传时间: 2019-07-01
详细说明:卡尔曼与贝叶斯 Python版本
本书教你如何解决这些过滤噪声问题,设计滤波器。 使用了许多不同的算法,但它们都基于贝叶斯概率。 简单来说,贝叶斯概率根据过去的信息确定可能是真实的。Contents
Preface
0.1 Kalman and Bayesian Filters
0.2 Motivation for this book
12
0.3 Reading Online
13
0. 4 PDF Version
13
0.5 Downloading and running the book
.....13
0.6 Jupyter
14
0.7 SciPy, NumPy, and matplotlib
15
0.7.1 Exercise-Create arrays
.,,,,,,,,,19
0.7.2 Solution
..,,,,.,.19
0.8 Companion Software
20
0. 9 Thoughts on Python and Coding Math
20
0.10 License
21
0.11 Contact
21
0.12 Resources
21
1 The g-h Filter
1.1 Building Intuition via Thought Experiments
1.2 The g-h Filter
35
1. 3 Notation
38
1.4 Exercise: Write Generic Algorithm
1.4.1 Solution and Discussion
着垂
1.5 Choice of g and h
1.6 Exercise: create measurement function
1.6.1 Solution
1.6.2 Discussion
41
1. 7 Exercise: Bad Initial Conditions
41
1.7.1 Solution and Discussion
1.8 Exercise: Extreme Noise
42
1.8.1 Solution and Discussion
42
1.9 Exercise: The Effect of Acceleration
42
1.9.1 Solution and Discussion
1.10 Exercise: Varying g
.43
1.10.1 Solution and Discussion
44
1.11V
46
1.12 Interactive Example
46
1.13 Don't lie to the filter
48
1. 14 Tracking a Train
1.15 g-h Filters with FilterP
53
1.16 Summar
3
CONTENTS
2 Discrete Bayes Filter
57
2.1 Tracking a Dog
57
2.2 Extracting Information from Sensor Readings
59
2.3 Noisy Sensors
60
2.4 Incorporating Movement
2.5 Terminology
2.6 Adding Uncertainty to the Prediction
66
2.7 Generalizing with Convolution
2.8 Integrating Measurements and Movement Updates
2. 9 The Discrete Bayes Algorithm
,,,,,,,74
2.10 The Effect of Bad Sensor Data
77
2.11 Drawbacks and limitations
2.12 Tracking and control
2.12.1 Simulating the Train behavior
2. 13 Bayes Theorem and the Total Probability Theorem
2. 14 Summary
85
2.15 Rcfo
rences
85
3 Probabilities, Gaussians, and Bayes'Theorem
87
3.1 Introduction
87
3.2 Mean, Variance, and Standard Deviations
3.2.1 Random Variables
7
3.3 Probability distribution
3.3.1 The mean, Median, and mode of a random variable
3. 4 Expected Value of a Random Variable
90
3.4.1 Exercise
3.4.2 Solution
91
3.4.3Eⅹ ercise..,
..92
3.4.4 Solution
92
3.4.5 Variance of a Random variable
····
92
3.4.6 Why the Square of the Differences
96
3.5 Gaussians
3.6 Nomenclature
3.7 Gaussian Distributions
3. 8 The Variance and belief
102
3.9The68-95-997Rule
103
3.10 Interactive Gaussians
104
3.11 Computational Properties of Gaussians
...105
3.12 Putting it all Together
.·
107
3. 12.1 Bayes Theorem
108
3.12.2 Total Probability Theorem
110
3.13 Computing Probabilities with scipystats
111
3. 14 Limitations of Using Gaussians to Model the World
112
3.15 Product of Gaussians(Optional)
115
3.16 Sum of Gaussians(Optional)
116
3. 17 Summary and Key points
.·
,,,,,,.,,,117
3.18 References
117
3.19 Useful Wikipedia Links
l18
CONTENTS
4 One Dimensional Kalman filters
119
4.1 Problem Description
119
4.2 Beliefs as gaussians
120
4.3 Tracking with Gaussian Probabilities
121
4.4 Predictions with gaussians
122
4.5 Updates with Gaussians
124
4.5.1 Understanding Gaussian Multiplication
125
4.5.2 Interactive Example
128
4.6 First Kalman filter
129
4.7 Code Walkthrough
132
4.7.1 Exercise: Modify Variance Values
.134
4.7.2 KF Animation
.134
4. 8 Kalman gain
....135
4.9 Full Description of the algorithm
.137
4.10 Comparison with g-h and discrete Bayes Filters
.138
4.11 Introduction to Designing a Filter
140
4.11.1 Animation
143
4.12 Example: Extreme Amounts of noise
.143
4.13 Example: Incorrect Process variance
144
4.14 Example: Bad Initial Estimate
.....145
4.15 Example: Large noise and Bad Initial Estimate
146
4.16 Exercise: Interactive Plots
垂垂
,,,,..148
4.161 Solution
4.17 Exercise- Nonlincar Systems
150
4.17.1 Solution
150
4.17.2 Discussion
151
4.18 Fixed Gain Filters
151
4.19 FilterPy's Implementation
152
4.20 Summary
152
5 Multivariate gaussians
155
5. 1 Introduction
155
5.2 Multivariate Normal distributions
..155
5.3 Correlation and Covariance
156
5.4 Multivariate Normal Distribution Equation
161
5.4.1 Pearson's Correlation Coefficient
171
5.5 Using Correlations to Improve Estimates
5.6 Multiplying Multidimensional Gaussians
...173
5.7 Hidden variables
.·
5.8 Higher Dimensions
183
5.9 Summary
183
5.10 References
,,,,,184
6 Multivariate Kalman Filters
185
6.1 Introduction
185
6.2 Newtons equations of Motion
.185
6.3 Kalman Filter Algorithm
186
6.4 Tracking a Dog
188
6.5 Predict Step
188
6.5.1 Design State Variable
188
6.5.2 Design State Covariance
190
6.5.3 Design the Process Model
191
6.5.4 Design Process Noise
...194
6.5.5 Design the Control Function
195
CONTENTS
6.6 Update Step
...196
6.6.1 Design the Measurement Function
196
6.7 Implementing the Kalman Filter
198
6. 8 The Saver Class
.202
6.9 The Kalman Filter equations
.204
6.9.1 Prediction Equations
205
6.9.2 Update Equations
.208
6.9.3 An Example not using FilterPy
.210
6.9.4 Summary
211
6.10 Exercise: Show Effect of hidden variables
,,,,,,.213
6.10.15olu
213
6.10.2 Discussion
.214
6. 11 How Velocity is Calculated
215
6. 12 Adjusting the Filter
217
6.13 A Detailed Examination of the Covariance matrix
.220
6. 14 Question: Explain Ellipse Differences
225
6. 14.1 Solution
225
6.15 Filter Initialization
226
6.16 Batch Processing
6.17 Smoothing the Results
,,,,229
6.18 Exercise: Compare Velocities
230
6.18.1 Solution
.,,231
6.19 Discussion and Summary
231
6.20 References
232
7 Kalman filter math
233
7.1 Modeling a Dynamic System
233
7.2 State-Space Representation of Dynamic Systems
235
7.2.1 Forming First Order Equations from Higher Order Equations
,,,236
7.2.2 First Order Differential Equations In State-Space Form
236
7.2.3 Finding the Fundamental Matrix for Time Invariant Systems
7.2.4 The Matrix Exponentia
.237
7. 2.5 Time Invariance
239
7.2.6 Linear Time Invariant Theory
240
7.2.7 Numerical Solutions
240
7.3 Design of the Process Noise Matrix
241
7. 3.1 Continuous white noise model
,,,,,,,241
7.3.2 Piecewise White Noise model
243
7.3.3 USing FilterPy to Compute Q
.·
..245
7.3.4 Simplification of Q
245
7.4 Stable Compution of the Posterior Covariance
24
7.5 Deriving the Kalman gain equation
248
7.6 Numeric Integration of Differential Equations
249
7.6.1 Eulers method
249
7.6.2 Runge Kutta Methods
7.7 Bayesian Filtering
.·
254
7.8 Converting Kalman Filter to a g-h Filter
255
7.9 References
257
CONTENTS
8 Designing Kalman Filters
259
8.1 Introduction
259
82 Tracking a Robot·
.259
8.2.1 Choose the State Variables
260
8.2.2 Design State Transition Function
261
8.2.3 Design the Process Noise matrix
262
8.2.4 Design the Control Function
262
8.2.5 Design the Measurement Function
.262
8.2.6 Design the Measurement Noise Matrix
263
8.2.7 Initial Conditions
.263
8.2.8 Implement the filter
263
8.3 Filter Order
266
8.3.1 Zero Order Kalman filter
.268
8.3.2 First Order Kalman filter
269
8.3.3 Second Order Kalman Filter
270
8.4 Evaluating Filter Order
271
8.5 Excrcisc: State Variable Design
284
8.5.1 Solution
.285
8.6 Detecting and Rejecting Bad Measurement
287
8.6.1 Gating and data Association Strategies
.....291
8.7 Evaluating Filter Performance
293
8.7.1 Normalized Estimated Error Squared(NEES)
8. 7.2 Likelihood Function
8.8 Control Inputs
8.9 Sensor Fusion
297
8.9.1 Exercise: Can you Filter gPS outputs?
302
8.9.2 Exercise: Prove that the position sensor improves the filter
306
8.10 Nonstationary Processes
307
8.10.1 Sensor fusion Different data rates
308
8.11 Tracking a Ball
垂
..310
8.11.1 Choose the state Variables
8.11.2 Design State Transition Function
..313
8.11.3 Design the Control Input Function
313
8.11. 4 Design the Measurement Function
314
8. 11.5 Design the Measurement Noise Matrix
314
8.11.6 Design the process Noise matrix
315
8.11.7 Design the Initial Conditions
315
8.12 Tracking a Ball in Air
.316
8.12. 1 Implementing Air Drag
317
8.13 References
325
9 Nonlinear Filtering
327
9.1 Introducti
327
9.2 The Problem with non linearity
328
9.3 An Intuitive Look at the problem
328
9. 4 The Effect of nonlinear Functions on gaussians
.·
9.5 A 2D Example
334
9.6 The A
t
orithms
337
9.7 Summar
.338
9. 8 Refe
338
CONTENTS
10 The Unscented Kalman filter
339
10.1 Sigma Points -Sampling from a Distribution
341
10. 2 A Quick Example
.342
10.3 Choosing Sigma Points
344
10.4 The Unscented Transform
10.4.1 Accuracy of the Unscented Transform
347
10.5 The Unscented Kalman Filter
.349
10.5.1 Predict Step
349
10.5.2 Update Step
349
10.6 Van der Merwe's Scaled Sigma Point Algorithm
.351
10.6.1 Sigma Point Computation
351
10.6.2 Weight Computation
...352
10.6.3 Reasonable Choices for the parameters
....352
10.7 Using the UKF
.352
10.8 Tracking an airplane
356
10.8.1 Tracking Maneuvering Aircraft
360
10.8.2 Sensor Fusion
10.8.3 Multiple position Sensors
365
10.9 Effects of sensor Error and Geometr
368
10.10Exercise: Explain Filter Performance
.....369
10.10.1 Solution
.369
10.11Implementation of the uKF
垂垂
....370
10.11.1 Weights
10.11. 2 Sigma Points
371
10. 11.3 Predict Step
.373
10.11. 4 Update Step
373
10.11.5 FilterPy's Implementation
374
10.12Batch Processing
374
10.13Smoothing the Results
377
10.14 Choosing the Sigma Parameters
378
10. 15Robot Localization- A Fully Worked Example
380
10.15.1 Robot motion model
10.15.2 Design the State Variables
10. 15.3 Design the System Model
382
10. 15.4 Design the Measurement Model
382
10.15.5 Design Measurement noise
383
10.15.6 Implementation
.383
10. 15.7 Steering the Robot
.387
10.16 Discussion
10.17References
11 The Extended Kalman Filter
391
11. 1 Linearizing the Kalman Filter
391
11.2 Example: Tracking a Airplane
393
11.2.1 Design the State Variables
394
11.2.2 Design the Process Model
.·
11.2.3 Design the Measurement Model
.395
11.2.4 Design Process and Measurement noise
397
11.2.5 Implementation
397
11.3 Using SymPy to compute Jacobians
400
11.4 Robot localization
400
11.4.1 Robot motion model
401
11.4.2 Design the State variables
401
11.4.3 Design the System Model
402
CONTENTS
11.4.4 Design the measurement model
404
11.4.5 Design Measurement Noise
405
11.4.6 Implementation
405
11.4.7 Discussion
11.5 UKF VS EKF
22
12 Particle filters
415
12.1 Motivation
415
12.2 Monte Carlo Sampling
416
12.3 Generic Particle Filter Algorithm
417
12.4 Probability distributions via Monte Carlo
b翻
418
12.5 The Particle Filter
421
垂垂
12.5.1 Predict Step
422
12.5.2 Update Step
422
12.5.3 Computing the State Estimate
423
12.5.4 Particle resampling
....423
12.6 SIR Filter-A Complete example
424
12.6.1 Effect of Sensor Errors on the filter
428
12.6.2 Filter Degeneracy From Inadequate Samples
429
12.7 Importance Sampling
430
12. 8 Resampling Method
..,,,,,,,,.432
12.8. 1 Multinomial Resampling
..,,,,,,.432
12.8. 2 Residual Resampling
...433
12.8.3 Stratified Resampling
434
12.8.4 Systematic Resampling
.435
12.8.5 Choosing a Resampling Algorithm
435
12.9 Summary
436
12.10References
..437
13 Smoothing
439
13.1 Introduction
439
13.2 An Overview of How smoothers work
441
13. 3 Types of Smoothers
441
134Ch
f filters
442
13.5 Fixed-Interval Smoothing
442
13.6 Fixed-Lag Smoothing
13.7 Referen
448
4 Adaptive Filtering
449
14.1 Introduction
449
14.2 Maneuvering Targets
449
14.3 Detecting a Maneuver
456
14.4 Adjustable Process noise
458
14.4.1 Continuous Adjustment
.458
14.4.2 Continuous Adjustment-Standard Deviation Version
460
14.5 Fading Memory Filter
14.6 Multiple model Estimation
14.6.1 A Two Filter Adaptive Filter
470
147 MMAE
472
147.1 Limitations of the mmae filter
474
14.8 Interacting Multiple Models(IMM)
.475
14.8.1 Mode Probabilitic
476
14.8. 2 Mode Transitions
476
14.83 Computing the Mode Probabilities
478
CONTENTS
14.9 Mixing Probabilities
149.1 IMM Estimate
14.9.2 Tracking Maneuvering Target with the IMM
480
480
14.9.3 Limitations of the IMM
482
14.10Summary
,,484
14.11 References·
484
A Installation
487
A1 Installing the SciPy Stack
487
A 2 Installing FilterPy
488
A3 Downloading and Running the Book
b翻
488
A4 Companion Software
489
A.5 Using Jupyter Notebook
489
A 6 SymP
489
A7 Various links
B Symbols and notations
493
B.1 Labbe
493
B2 Wikipedia
B 3 Brookner
493
B 4 Gelb
494
B5 Brown
494
B6 Zarchan
494
C INfinity filter
495
D Ensemble Kalman Filters
497
D. 1 The Algorithm
498
D.1.1 Initialize Step
499
D 1.2 Predict Ste
499
D 1.3 Update
Ste
499
D2 Implementation and example
501
D 3 Outstanding Questions
503
D 4 References
504
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.