亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? upf_demo.m

?? 無忌卡爾曼粒子濾波
?? M
?? 第 1 頁 / 共 3 頁
字號:
%/upf_demos/
% PURPOSE : Demonstrate the differences between the following filters on the same problem:
%           
%           1) Extended Kalman Filter  (EKF)
%           2) Unscented Kalman Filter (UKF)
%           3) Particle Filter         (PF)
%           4) PF with EKF proposal    (PFEKF)
%           5) PF with UKF proposal    (PFUKF)

% For more details refer to:

% AUTHORS  : Nando de Freitas      (jfgf@cs.berkeley.edu)
%            Rudolph van der Merwe (rvdmerwe@ece.ogi.edu)
% DATE     : 17 August 2000

clear all;
clc;
echo off;
path('./ukf',path);

% INITIALISATION AND PARAMETERS:

no_of_runs = 5            % number of experiments to generate statistical
                            % averages
doPlot = 0;                 % 1 plot online. 0 = only plot at the end.
sigma =  1e-5;              % Variance of the Gaussian measurement noise.
g1 = 3;                     % Paramater of Gamma transition prior.
g2 = 2;                     % Parameter of Gamman transition prior.
                            % Thus mean = 3/2 and var = 3/4.
T = 60;                     % Number of time steps.
R = 1e-5;                   % EKF's measurement noise variance. 
Q = 3/4;                    % EKF's process noise variance.
P0 = 3/4;                   % EKF's initial variance of the states.

N = 200;                     % Number of particles.
resamplingScheme = 1;       % The possible choices are
                            % systematic sampling (2),
                            % residual (1)
                            % and multinomial (3). 
                            % They're all O(N) algorithms. 

Q_pfekf = 10*3/4;
R_pfekf = 1e-1;

Q_pfukf = 2*3/4;
R_pfukf = 1e-1;
			    
alpha = 1;                  % UKF : point scaling parameter
beta  = 0;                  % UKF : scaling parameter for higher order terms of Taylor series expansion 
kappa = 2;                  % UKF : sigma point selection scaling parameter (best to leave this = 0)

%**************************************************************************************
% SETUP BUFFERS TO STORE PERFORMANCE RESULTS
% ==========================================

rmsError_ekf      = zeros(1,no_of_runs);
rmsError_ukf      = zeros(1,no_of_runs);
rmsError_pf       = zeros(1,no_of_runs);
rmsError_pfMC     = zeros(1,no_of_runs);
rmsError_pfekf    = zeros(1,no_of_runs);
rmsError_pfekfMC  = zeros(1,no_of_runs);
rmsError_pfukf    = zeros(1,no_of_runs);
rmsError_pfukfMC  = zeros(1,no_of_runs);

time_pf       = zeros(1,no_of_runs);     
time_pfMC     = zeros(1,no_of_runs);
time_pfekf    = zeros(1,no_of_runs);
time_pfekfMC  = zeros(1,no_of_runs);
time_pfukf    = zeros(1,no_of_runs);
time_pfukfMC  = zeros(1,no_of_runs);

%******************************************

% MAIN LOOP

for j=1:no_of_runs,

  rand('state',sum(100*clock));   % Shuffle the pack!
  randn('state',sum(100*clock));   % Shuffle the pack!  

% GENERATE THE DATA:
% ==================
x = zeros(T,1);
y = zeros(T,1);
processNoise = zeros(T,1);
measureNoise = zeros(T,1);
x(1) = 1;                         % Initial state.
for t=2:T
  processNoise(t) = gengamma(g1,g2);  
  measureNoise(t) = sqrt(sigma)*randn(1,1);    
  x(t) = feval('ffun',x(t-1),t) +processNoise(t);     % Gamma transition prior.  
  y(t) = feval('hfun',x(t),t) + measureNoise(t);      % Gaussian likelihood.
end;  

% PLOT THE GENERATED DATA:
% ========================
figure(1)
clf;
plot(1:T,x,'r',1:T,y,'b');
ylabel('Data','fontsize',15);
xlabel('Time','fontsize',15);
legend('States (x)','Observations(y)');

%%%%%%%%%%%%%%%  PERFORM EKF and UKF ESTIMATION  %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%  ==============================  %%%%%%%%%%%%%%%%%%%%%

% INITIALISATION:
% ==============
mu_ekf = ones(T,1);     % EKF estimate of the mean of the states.
P_ekf = P0*ones(T,1);   % EKF estimate of the variance of the states.

mu_ukf = mu_ekf;        % UKF estimate of the mean of the states.
P_ukf = P_ekf;          % UKF estimate of the variance of the states.

yPred = ones(T,1);      % One-step-ahead predicted values of y.
mu_ekfPred = ones(T,1); % EKF O-s-a estimate of the mean of the states.
PPred = ones(T,1);      % EKF O-s-a estimate of the variance of the states.
disp(' ');

for t=2:T,    
  fprintf('run = %i / %i :  EKF & UKF : t = %i / %i  \r',j,no_of_runs,t,T);
  fprintf('\n')
  
  % PREDICTION STEP:
  % ================ 
  mu_ekfPred(t) = feval('ffun',mu_ekf(t-1),t);
  Jx = 0.5;                             % Jacobian for ffun.
  PPred(t) = Q + Jx*P_ekf(t-1)*Jx'; 
  
  % CORRECTION STEP:
  % ================
  yPred(t) = feval('hfun',mu_ekfPred(t),t);
  if t<=30,
    Jy = 2*0.2*mu_ekfPred(t);                 % Jacobian for hfun.
  else
    Jy = 0.5;
  %  Jy = cos(mu_ekfPred(t))/2;
  %   Jy = 2*mu_ekfPred(t)/4;                 % Jacobian for hfun. 
  end;
  M = R + Jy*PPred(t)*Jy';                 % Innovations covariance.
  K = PPred(t)*Jy'*inv(M);                 % Kalman gain.
  mu_ekf(t) = mu_ekfPred(t) + K*(y(t)-yPred(t));
  P_ekf(t) = PPred(t) - K*Jy*PPred(t);
  
  % Full Unscented Kalman Filter step
  % =================================
  [mu_ukf(t),P_ukf(t)]=ukf1(mu_ukf(t-1),P_ukf(t-1),[],Q,'ukf_ffun',y(t),R,'ukf_hfun',t,alpha,beta,kappa);  
  
end;   % End of t loop.



%%%%%%%%%%%%%%%  PERFORM SEQUENTIAL MONTE CARLO  %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%  ==============================  %%%%%%%%%%%%%%%%%%%%%

% INITIALISATION:
% ==============
xparticle_pf = ones(T,N);        % These are the particles for the estimate
                                 % of x. Note that there's no need to store
                                 % them for all t. We're only doing this to
                                 % show you all the nice plots at the end.
xparticlePred_pf = ones(T,N);    % One-step-ahead predicted values of the states.
yPred_pf = ones(T,N);            % One-step-ahead predicted values of y.
w = ones(T,N);                   % Importance weights.
disp(' ');
 
tic;                             % Initialize timer for benchmarking

for t=2:T,    
  fprintf('run = %i / %i :  PF : t = %i / %i  \r',j,no_of_runs,t,T);
  fprintf('\n')
  
  % PREDICTION STEP:
  % ================ 
  % We use the transition prior as proposal.
  for i=1:N,
    xparticlePred_pf(t,i) = feval('ffun',xparticle_pf(t-1,i),t) + gengamma(g1,g2);   
  end;

  % EVALUATE IMPORTANCE WEIGHTS:
  % ============================
  % For our choice of proposal, the importance weights are give by:  
  for i=1:N,
    yPred_pf(t,i) = feval('hfun',xparticlePred_pf(t,i),t);        
    lik = inv(sqrt(sigma)) * exp(-0.5*inv(sigma)*((y(t)-yPred_pf(t,i))^(2))) + 1e-99; % Deal with ill-conditioning.
    w(t,i) = lik;    
  end;  
  w(t,:) = w(t,:)./sum(w(t,:));                % Normalise the weights.
  
  % SELECTION STEP:
  % ===============
  % Here, we give you the choice to try three different types of
  % resampling algorithms. Note that the code for these algorithms
  % applies to any problem!
  if resamplingScheme == 1
    outIndex = residualR(1:N,w(t,:)');        % Residual resampling.
  elseif resamplingScheme == 2
    outIndex = systematicR(1:N,w(t,:)');      % Systematic resampling.
  else  
    outIndex = multinomialR(1:N,w(t,:)');     % Multinomial resampling.  
  end;
  xparticle_pf(t,:) = xparticlePred_pf(t,outIndex); % Keep particles with
                                                    % resampled indices.
end;   % End of t loop.

time_pf(j) = toc;    % How long did this take?


%%%%%%%%%%%%%%  PERFORM SEQUENTIAL MONTE CARLO WITH MCMC  %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%  ========================================  %%%%%%%%%%%%%%%%

% INITIALISATION:
% ==============
xparticle_pfMC = ones(T,N);      % These are the particles for the estimate
                                 % of x. Note that there's no need to store
                                 % them for all t. We're only doing this to
                                 % show you all the nice plots at the end.
xparticlePred_pfMC = ones(T,N);  % One-step-ahead predicted values of the states.
yPred_pfMC = ones(T,N);          % One-step-ahead predicted values of y.
w = ones(T,N);                   % Importance weights.
previousXMC = ones(T,N);         % Particles at the previous time step. 
previousXResMC = ones(T,N);      % Resampled previousX.
disp(' ');
 
tic;                             % Initialize timer for benchmarking

for t=2:T,    
  fprintf('run = %i / %i :  PF-MCMC : t = %i / %i  \r',j,no_of_runs,t,T);
  fprintf('\n')
  
  % PREDICTION STEP:
  % ================ 
  % We use the transition prior as proposal.
  for i=1:N,
    xparticlePred_pfMC(t,i) = feval('ffun',xparticle_pfMC(t-1,i),t) + gengamma(g1,g2);   
  end;
  previousXMC(t,:) = xparticle_pfMC(t-1,:);  % Store the particles at t-1. 

  % EVALUATE IMPORTANCE WEIGHTS:
  % ============================
  % For our choice of proposal, the importance weights are give by:  
  for i=1:N,
    yPred_pfMC(t,i) = feval('hfun',xparticlePred_pfMC(t,i),t);        
    lik = inv(sqrt(sigma)) * exp(-0.5*inv(sigma)*((y(t)-yPred_pfMC(t,i))^(2))) + 1e-99; % Deal with ill-conditioning.
    w(t,i) = lik;    
  end;  
  w(t,:) = w(t,:)./sum(w(t,:));                % Normalise the weights.
  
  % SELECTION STEP:
  % ===============
  % Here, we give you the choice to try three different types of
  % resampling algorithms. Note that the code for these algorithms
  % applies to any problem!
  if resamplingScheme == 1
    outIndex = residualR(1:N,w(t,:)');        % Residual resampling.
  elseif resamplingScheme == 2
    outIndex = systematicR(1:N,w(t,:)');      % Systematic resampling.
  else  
    outIndex = multinomialR(1:N,w(t,:)');     % Multinomial resampling.  
  end;
  xparticle_pfMC(t,:) = xparticlePred_pfMC(t,outIndex); % Keep particles with resampled indices.
  
  previousXResMC(t,:) = previousXMC(t,outIndex);  % Resample particles at t-1.
  
  % METROPOLIS-HASTINGS STEP:
  % ========================
  u=rand(N,1); 
  accepted=0;
  rejected=0;
  for i=1:N,   
    xProp = feval('ffun',previousXResMC(t,i),t) + gengamma(g1,g2);   
    mProp = feval('hfun',xProp,t);        
    likProp = inv(sqrt(sigma)) * exp(-0.5*inv(sigma)*((y(t)-mProp)^(2))) + 1e-99;     
    m = feval('hfun',xparticle_pfMC(t,i),t);        
    lik = inv(sqrt(sigma)) * exp(-0.5*inv(sigma)*((y(t)-m)^(2))) + 1e-99;     
    acceptance = min(1,likProp/lik);
    if u(i,1) <= acceptance 
      xparticle_pfMC(t,i) = xProp;
      accepted=accepted+1;
    else
      xparticle_pfMC(t,i) = xparticle_pfMC(t,i); 
      rejected=rejected+1;
    end;
  end;  
  
end;   % End of t loop.

time_pfMC(j) = toc;    % How long did this take?


%%%%%%%%%%%%%%%  PERFORM SEQUENTIAL MONTE CARLO  %%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%  ======== EKF proposal ========  %%%%%%%%%%%%%%%%%%%%%

% INITIALISATION:
% ==============
xparticle_pfekf = ones(T,N);        % These are the particles for the estimate
                                    % of x. Note that there's no need to store
                                    % them for all t. We're only doing this to
                                    % show you all the nice plots at the end.
Pparticle_pfekf = P0*ones(T,N);     % Particles for the covariance of x.
xparticlePred_pfekf = ones(T,N);    % One-step-ahead predicted values of the states.
PparticlePred_pfekf = ones(T,N);    % One-step-ahead predicted values of P.
yPred_pfekf = ones(T,N);            % One-step-ahead predicted values of y.
w = ones(T,N);                      % Importance weights.
muPred_pfekf = ones(T,1);           % EKF O-s-a estimate of the mean of the states.
PPred_pfekf = ones(T,1);            % EKF O-s-a estimate of the variance of the states.
mu_pfekf = ones(T,1);               % EKF estimate of the mean of the states.
P_pfekf = P0*ones(T,1);             % EKF estimate of the variance of the states.
disp(' ');

tic;                                % Initialize timer for benchmarking

for t=2:T,    
  fprintf('run = %i / %i :  PF-EKF : t = %i / %i  \r',j,no_of_runs,t,T);
  fprintf('\n')
  
  % PREDICTION STEP:
  % ================ 
  % We use the EKF as proposal.
  for i=1:N,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
同产精品九九九| 国产欧美久久久精品影院| 亚洲精品中文字幕乱码三区| 国产精品影音先锋| 精品国精品国产尤物美女| 久久99这里只有精品| 久久日一线二线三线suv| 丁香六月久久综合狠狠色| 中文字幕av在线一区二区三区| 不卡的av在线播放| 亚洲精品视频免费看| 91精品国产一区二区三区| 久久国产精品无码网站| 中文欧美字幕免费| 日本道精品一区二区三区 | 久久久电影一区二区三区| 国产传媒久久文化传媒| 最新欧美精品一区二区三区| 欧美亚洲综合在线| 久久精品999| 中文字幕一区二区在线播放| 欧美自拍偷拍一区| 久久er99热精品一区二区| 国产精品欧美一区二区三区| 91久久国产最好的精华液| 日韩av二区在线播放| 国产丝袜在线精品| 91福利小视频| 国产精品亚洲综合一区在线观看| 亚洲欧美日韩在线| 欧美一区二区在线播放| 成人一区二区视频| 性欧美大战久久久久久久久| 精品动漫一区二区三区在线观看| av福利精品导航| 日本特黄久久久高潮| 国产日本一区二区| 在线观看91av| 97久久超碰国产精品电影| 日韩黄色免费电影| 中文字幕一区二区三区不卡在线| 欧美久久久久久久久| 成人午夜视频在线观看| 三级在线观看一区二区| 国产日本欧美一区二区| 在线不卡免费欧美| 色香色香欲天天天影视综合网| 精品一区二区三区欧美| 亚洲电影视频在线| 日本一区二区三级电影在线观看| 欧美疯狂性受xxxxx喷水图片| 国产电影一区在线| 欧美aaaaaa午夜精品| 亚洲国产美国国产综合一区二区| 久久久久久久综合色一本| 538prom精品视频线放| 91国模大尺度私拍在线视频| 国产精品69久久久久水密桃| 裸体一区二区三区| 日精品一区二区三区| 国产精品嫩草99a| 久久久久久亚洲综合影院红桃| 91麻豆精品国产91久久久久| 91国偷自产一区二区开放时间| 春色校园综合激情亚洲| 国产精品18久久久久久久久久久久 | 亚洲国产你懂的| 亚洲人成伊人成综合网小说| 欧美激情综合网| 久久久久9999亚洲精品| 欧美不卡激情三级在线观看| 欧美一区二区三区视频免费播放| 欧美亚洲丝袜传媒另类| 一本色道综合亚洲| 91麻豆精品一区二区三区| 成人综合婷婷国产精品久久蜜臀 | 久久久久久久久久看片| 欧美mv和日韩mv国产网站| 日韩一区二区电影| 91精品国产91热久久久做人人| 欧美日韩亚洲综合一区| 欧美日韩视频在线第一区| 欧美丝袜第三区| 欧美日韩三级一区二区| 欧美日韩国产中文| 欧美一区二区三区视频在线观看| 欧美精品欧美精品系列| 欧美精品tushy高清| 欧美一级淫片007| 欧美不卡一区二区三区四区| 国产午夜亚洲精品午夜鲁丝片| 亚洲国产精品成人综合| 亚洲欧美在线观看| 一级精品视频在线观看宜春院| 亚洲国产日韩av| 日本不卡视频在线| 国产一区999| 不卡在线观看av| 在线亚洲免费视频| 欧美一区午夜精品| 国产日韩欧美麻豆| 亚洲日本在线天堂| 日韩精品国产精品| 国产一区二区主播在线| 99久久婷婷国产综合精品电影| 在线观看av一区二区| 日韩免费看的电影| 国产精品免费久久| 亚洲一区二区五区| 狠狠色丁香婷综合久久| www.亚洲在线| 欧美一区二区视频网站| 国产亚洲欧美日韩在线一区| 亚洲精品国产视频| 精品一区二区成人精品| 成人18视频在线播放| 91精品国产乱| 国产精品无遮挡| 偷拍亚洲欧洲综合| av成人动漫在线观看| 91精品国产综合久久福利| 国产精品天美传媒沈樵| 午夜电影一区二区三区| 国产精品99久久久久久久女警| 在线精品亚洲一区二区不卡| 欧美精品一区二区三区蜜桃视频| 亚洲人成在线播放网站岛国| 久久精品国产精品亚洲红杏| 日本韩国欧美一区| 26uuu久久天堂性欧美| 一个色综合网站| 成人激情黄色小说| 久久综合999| 亚洲成人第一页| 成人国产亚洲欧美成人综合网 | 亚洲视频一区二区免费在线观看| 日本视频一区二区| 日本久久电影网| 国产欧美精品一区aⅴ影院| 日韩av电影免费观看高清完整版| 99国产精品久久久久久久久久久| 欧美xxxxx牲另类人与| 亚洲国产美女搞黄色| 色综合天天综合色综合av | 国产清纯白嫩初高生在线观看91 | 午夜久久电影网| a级精品国产片在线观看| 欧美va亚洲va在线观看蝴蝶网| 亚洲一区二区成人在线观看| jiyouzz国产精品久久| 精品国产99国产精品| 日本不卡一区二区三区高清视频| 日本道色综合久久| 亚洲女同一区二区| fc2成人免费人成在线观看播放 | 欧美性猛片aaaaaaa做受| 欧美激情综合网| 成人综合在线视频| 欧美激情综合五月色丁香小说| 国产精品自在在线| 久久欧美中文字幕| 国产福利一区二区| 久久精品夜色噜噜亚洲aⅴ| 久久精品国产99国产| 欧美成人a视频| 久久99国产精品免费网站| 欧美日本在线看| 日韩电影在线看| 制服.丝袜.亚洲.另类.中文| 香蕉影视欧美成人| 欧美精品久久一区二区三区| 亚洲福利一区二区| 正在播放一区二区| 奇米影视一区二区三区小说| 欧美一区二区三区在线看| 免费观看30秒视频久久| 精品99一区二区| 国产精品羞羞答答xxdd| 国产精品国产成人国产三级| www.综合网.com| 亚洲综合免费观看高清在线观看 | 欧美亚洲国产一区二区三区 | 亚洲一卡二卡三卡四卡| 精品视频一区二区三区免费| 午夜精品一区二区三区免费视频 | 亚洲欧美日本在线| 色天天综合久久久久综合片| 亚洲乱码国产乱码精品精98午夜| 欧美性感一区二区三区| 人人精品人人爱| 久久九九久精品国产免费直播| 成人免费视频一区| 夜夜操天天操亚洲| 欧美乱熟臀69xxxxxx| 久久99精品国产91久久来源| 国产精品第一页第二页第三页| 色8久久人人97超碰香蕉987| 麻豆91在线观看| 国产精品理论片在线观看| 91福利国产成人精品照片|