楼主: hanszhu
21242 24

[下载]Gauss kalman filter [推广有奖]

  • 0关注
  • 34粉丝

已卖:4535份资源

院士

27%

还不是VIP/贵宾

-

TA的文库  其他...

Clojure NewOccidental

Job and Interview

Perl资源总汇

威望
7
论坛币
144575308 个
通用积分
68.9538
学术水平
37 点
热心指数
38 点
信用等级
25 点
经验
31240 点
帖子
1873
精华
1
在线时间
802 小时
注册时间
2005-1-3
最后登录
2024-10-15

楼主
hanszhu 发表于 2005-1-14 13:29:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
Gauss kalman filter 7947.zip (23.16 KB) 本附件包括:
  • CHSIOUT.DAT
  • KFANAL
  • KFANAL.OUT
  • KFCHECK.1
  • KFCHECK.2
  • KFCHECK.OUT
  • KFFILT
  • KFFILT.BAK
  • KFGRAPH.RAT
  • KFSEEK.OUT
  • KFSMO
  • MONOUT.DAT
  • POUT.DAT
  • README.DOC
  • REAL.DAT
  • Kfseek


[此贴子已经被作者于2005-1-14 13:31:00编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:kalman filter GAUSS Aus ALM 下载 GAUSS filter kalman

已有 1 人评分经验 论坛币 学术水平 收起 理由
xuehe + 100 + 100 + 4 根据规定进行奖励

总评分: 经验 + 100  论坛币 + 100  学术水平 + 4   查看全部评分

沙发
hanszhu 发表于 2005-1-14 13:33:00
If it is working properly, please let me know. I will upload other add-ins for GAUSS.

藤椅
hanszhu 发表于 2005-1-15 13:56:00

Kalman Filtering Dan Simon Innovatia Software dansimon@innovatia.com ã 1998–2001 Innovatia Software. All Rights Reserved.

Preliminaries

We humans have been filtering things for virtually our entire history. Water filtering is a simple example. We can filter impurities from water as simply as using our hands to skim dirt and leaves off the top of the water. Another example is filtering out noise from our surroundings. If we paid attention to all the little noises around us we would go crazy. We learn to ignore superfluous sounds (traffic, applicances, etc.) and focus on important sounds, like the voice of the person we're speaking with.

There are also many examples in engineering where filtering is desirable. Radio communications signals are often corrupted with noise. A good filtering algorithm can remove the noise from electromagnetic signals while still retaining the useful information. Another example is voltages. Many countries require in-home filtering of line voltages in order to power personal computers and peripherals. Without filtering, the power fluctuations would drastically shorten the useful lifespan of the devices.

Kalman filtering is a relatively recent (1960) development in filtering, although it has its roots as far back as Gauss (1795). Kalman filtering has been applied in areas as diverse as aerospace, marine navigation, nuclear power plant instrumentation, demographic modeling, manufactring, and many others. This paper uses a tutorial, example-based approach to explain Kalman filtering.

Mathematics

Consider the problem of estimating the variables of some system. In dynamic systems (that is, systems which vary with time) the system variables are often denoted by the term state variables. Assume that the system variables, represented by the vector x, are governed by the equation xk+1 = Axk + wk where wk is random process noise, and the subscripts on the vectors represent the time step. For instance, if our dynamic system consists of a spacecraft which is accelerating with random bursts of gas from its Reaction Control System thrusters, the vector x might consist of position p and velocity v. Then the system equation would be

Equation 1

where ak is the random, time-varying acceleration and T is the time between step k and step k+1. Now suppose we can measure the position p. Then our measurement at time k can be denoted zk = pk + vk where vk is random measurement noise.

The question which is addressed by the Kalman filter is this: Given our knowledge of the behavior of the system, and given our measurements, what is the best estimate of position and velocity? We know how the sytem behaves according to the system equation, and we have measurements of the position, so how can we determine the best estimate of the system variables? Surely we can do better than just take each measurement at its face value, especially if we suspect that we have a lot of measurement noise.

The Kalman filter is formulated as follows. Suppose we assume that the process noise wk is white gaussian noise with a covariance matrix Q. Further assume that the measurement noise is white gaussian noise with a covariance matrix R, and that it is not correlated with the process noise. We might want to formulate an estimation algorithm such that the following statistical conditions hold:

1. The expected value of our estimate is equal to the expected value of the state. That is, "on average," our estimate of the state will equal the true state.

2. We want an estimation algorithim such that of all possible estimation algorithms, our algorithm minimizes the expected value of the square of the estimation error. That is, "on average," our algorithm gives the "smallest" possible estimation error.

It so happens that the Kalman filter is the estimation algorithm which satisfies these criteria. There are many alternative ways to formulate the Kalman filter equations. One of the formulations is given in the following equations.

Equations 2 - 5

In the above equations, the superscript -1 indicates matrix inversion and the superscript T indicates matrix transposition. S is called the covariance of the innovation, K is called the gain matrix, and P is called the covariance of the prediction error.

Equation 5 is fairly intuitive. The first term used to derive the state estimate at time k+1 is just A times the state estimate at time k. This would be the state estimate if we didn't have a measurement. In other words, the state estimate propagates in time just like the state vector (see Equation 1). The second term in Equation 5 is called the corrector term, and it represents how much to correct the propagated estimated due to our measurement. Inspection of Equation 5 indicates that if the measurement noise is much greater than the process noise, K will be small (that is, we won't give much credence to the measurement); if the measurement nosie is much smaller than the process noise, K will be large (that is, we will give a lot of credence to the measurement).

Example

Let's look at an example. The system represented by Equation 1 was simulated on a computer with random bursts of acceleration which had a standard deviation of 0.5 feet/sec2. The position was measured with an error of 10 feet (one standard deviation). The figure shows how well the Kalman Filter was able to estimate the position, in spite of the large measurement noise.

The MATLAB program that I used to generate the above results is available for downloading. Don't worry if you don't know MATLAB -- it's an easy-to-read language, almost like pseudo code. The parameters I used to generate the above results were alpha = 1, dt = 0.5, and duration = 30. If you use MATLAB to run the program you will get different results every time because of the random noise that is simulated, but the results will be similar to the above plot. Click here to download the MATLAB file.

Kalman filtering is a huge field whose depths we cannot hope to begin to plumb in such a brief paper as this. Thousands of papers and dozens of textbooks have been written on this subject since its inception in 1960. Some issues which complicate the application of the Kalman filter are as follows.

1. We have assumed that the system equation is linear (see Equation 1). What if the equation is nonlinear?

2. What if the measurement noise and process noise are not Gaussian, not white, and not independent of each other?

3. What if the statistics (for example, the covariance matrix) of the noise is not known?

4. What if, rather than estimating the state of a system as measurements are made, we already have all the measurements and we want to reconstruct a time history of the state? Can we do better than a Kalman filter? It would seem that we could since we have more information available (that is, we have future measurements) to estimate the state at a given time. This is called the smoothing problem.

5. Equations 2 -- 5 are matrix equations, and as such can impose a large computational burden for high-dimensional systems. Is there a way to approximate the Kalman filter for large systems, reducing the computational load while still approaching the theoretical optimum of the Kalman filter?

6. What if the noise characteristics change with time? Can we somehow formulate a Kalman filter that adapts over time to changes in the noise characteristics?

7. What if, rather than desired to minimize the "average" estimation error, we desire to minimize the "worst case" estimation error? This is known as the minimax or H-infinity estimation problem. Innovatia Software has a white paper on this topic entitled Minimax Filtering.

References

As I mentioned above, there have been dozens of books written about Kalman filtering. Two texts that I've found particularly helpful in my study and application of Kalman filters are the following.

  • B. Anderson and J. Moore, "Optimal Filtering," Prentice-Hall, 1979.

  • Gelb, "Applied Optimal Estimation," The MIT Press, 1974.

The use of Kalman filters requires a lot of matrix algebra. Some helpful books on this topic are the following.

  • G. Golub and C. Van Loan, "Matrix Computations," The Johns Hopkins University Press, 1989.

  • R. Horn and C. Johnson, "Matrix Analysis," Cambridge University Press, 1985.

Some of the classic papers on Kalman filtering have been reprinted by the IEEE in the following useful volume.

  • H. Sorenson, "Kalman Filtering: Theory and Application," IEEE Press, 1985.

Peter D. Joseph's web page is a useful resource on the topic of Kalman filtering. Doctor Joseph has worked with Kalman filters since their inception in 1960, and coauthored perhaps the earliest text on the subject (1968). His web page includes lessons for the beginning, intermediate, and advanced student.

Here are some other nice web pages on the subject.

板凳
leonis 发表于 2005-1-16 00:09:00
谢谢 我最近正对状态空间模型感兴趣,而卡尔曼率波就是这个解状态空间模型最好的数学工具。

报纸
leonis 发表于 2005-1-16 00:22:00
呵呵~你那个gauss kalman filer 程序,我没记错的话应该是Hamilton在handbook of econometrics vol 4中的一篇文章的例子。

地板
hanszhu 发表于 2005-2-11 07:43:00

Econometrics II: Course Syllabus

Spring 2002, Prof. K.-P. Lin (N-216, Tel: 6278-9797)

Textbooks

  • W. H. Greene, Econometric Analysis, 4th Ed., Prentice Hall, 1999.
  • K.-P. Lin, Computational Econometrics: GAUSS Programming for Econometricians and Financial Analysts, ETEXT Textbook Publisher, Los Angeles, 2001. (Chinese Version)

Software and Manual

  • GAUSS 4.0 for Windows Student Version, Aptech Systems, 2002. The full version of GAUSS 4.0 for Windows is also available in the Lab.
  • GPE2 (GAUSS Programming for Econometricians and Financial Analysts) for GAUSS.

Course Topics

Case Study

[此贴子已经被作者于2005-2-11 7:51:50编辑过]

7
hanszhu 发表于 2005-2-11 08:09:00

8
hanszhu 发表于 2005-2-11 08:14:00

Useful Gauss Codes

  • Gauss code for the Triples Asymmetry Test for "Business Cycle Asymmetries: International Evidence" by Weshah Razzak RePEc:red:ccodes:razzak01
  • GAUSS code for a basic model with money, cash-in-advance constraint by Gary D. Hansen RePEc:cre:qmrbcd:8
  • GAUSS code for an overlapping generations model with inelastic labor supply by Gary D. Hansen RePEc:cre:qmrbcd:9
  • GAUSS code for the Imrohoroglu (1989) model without aggregate uncertainty by Gary D. Hansen RePEc:cre:qmrbcd:10

GAUSS 5.0 (Aptech Systems)

A

B

C

  • John Cochrane's Programs for finance, macro, monetary economics and time series analysis

D

E

  • Matias Eklöf provides a 40 page Introduction to GAUSS 3.2 for Windows, 2001 and sample programs for Graduate Econometrics Course

G

H

  • Wouter den Haan published GAUSS code for his VARHAC estimator
  • James D. Hamilton (UCSD) published his GAUSS programs for flexible nonlinear inference, Econometrica, 2001
  • Bruce Hansen (U of Wisc.) wrote free programs for TAR models, stability and linearity testing
  • Bart Hobijn (NY FRB) wrote free programs for lots of modern stationarity (KPSS, Leybourne McCabe) and multivariate (seasonal) unit root tests (non cointegration). Bart's personal homepage.
  • Joel Horowitz (U of Iowa) wrote free programs for semiparametric and GMM estimation

I

K

L

L

O

R

S

T

  • Kenneth Train provides free code for mixed logit estiomation for panel data.

V

W

  • Frank Windmeijer provides EXPEND, A Gauss programme for non-linear GMM estimation of exponential models with endogenous regressors for cross section and panel (dynamic) count data models
  • GAUSSX 4.0 [US] by Jon Breslaw

9
hanszhu 发表于 2005-2-11 08:16:00

GAUSS Programs on the Net

Third Party Applications

GAUSS-to-Matlab and Matlab-to GAUSS Conversion Utilities

10
hanszhu 发表于 2005-2-11 08:18:00

GAUSS Source Code Archive at American University

Please email suggestions for additions to this resource list to aisaac AT american DOT edu.

Code Archived Elsewhere

A Few Commercial Products

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-6 04:14