我来我网
https://5come5.cn
 
您尚未 登录  注册 | 菠菜 | 软件站 | 音乐站 | 邮箱1 | 邮箱2 | 风格选择 | 更多 » 
 

本页主题: kalman filter的matlab仿真 显示签名 | 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

80522957



性别: 帅哥 状态: 该用户目前不在线
等级: 栋梁之材
发贴: 989
威望: 0
浮云: 1163
在线等级:
注册时间: 2005-09-02
最后登陆: 2007-05-14

5come5帮你背单词 [ eraser /i'reizə/ n. 橡皮 ]


kalman filter的matlab仿真

function [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, model)
% Kalman filter.
% [x, V, VV, loglik] = kalman_filter(y, A, C, Q, R, init_x, init_V, model)
%
% Inputs:
% y(:,t)   - the observation at time t
% A(:,:,m) - the system matrix for model m
% C(:,:,m) - the observation matrix for model m
% Q(:,:,m) - the system covariance for model m
% R(:,:,m) - the observation covariance for model m
% init_x(:,m) - the initial state for model m
% init_V(:,:,m) - the initial covariance for model m
% model(t) - which model to use at time t (defaults to model 1 if not specified)
%
% Outputs:
% x(:,t) = E[X_t | t]
% V(:,:,t) = Cov[X_t | t]
% VV(:,:,t) = Cov[X_t, X_t-1 | t] t >= 2
% loglik = sum_t log P(Y_t)

[os T] = size(y);
ss = size(A,1);

if nargin<8, model = ones(1, T); end

x = zeros(ss, T);
V = zeros(ss, ss, T);
VV = zeros(ss, ss, T);

loglik = 0;
for t=1:T
m = model(t);
if t==1
  prevx = init_x(:,m);
  prevV = init_V(:,:,m);
  initial = 1;
else
  prevx = x(:,t-1);
  prevV = V(:,:,t-1);
  initial = 0;
end
[x(:,t), V(:,:,t), LL, VV(:,:,t)] = ...
    kalman_update(A(:,:,m), C(:,:,m), Q(:,:,m), R(:,:,m), y(:,t), prevx, prevV, initial);
loglik = loglik + LL;
end
顶端 Posted: 2007-03-29 09:31 | [楼 主]
我来我网·5come5 Forum » 学业有成

Total 0.019588(s) query 4, Time now is:01-08 04:55, Gzip enabled
Powered by PHPWind v5.3, Localized by 5come5 Tech Team, 黔ICP备16009856号