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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? upf_demo.m

?? 無(wú)忌卡爾曼粒子濾波
?? M
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
%/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,

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区在线看| 成人av网站大全| 久久亚洲欧美国产精品乐播 | 粗大黑人巨茎大战欧美成人| 一区二区三区欧美在线观看| 久久综合色8888| 欧美日韩亚洲综合| 不卡视频在线看| 极品美女销魂一区二区三区| 亚洲国产精品麻豆| 国产精品久久二区二区| 日韩精品中文字幕一区二区三区| 色综合色综合色综合| 国产精品综合一区二区| 免费成人深夜小野草| 亚洲精品高清视频在线观看| 欧美激情在线一区二区三区| 精品乱人伦小说| 欧美男男青年gay1069videost| 99久久99久久精品免费观看| 国产麻豆午夜三级精品| 久久精品国产一区二区| 成人性色生活片免费看爆迷你毛片| 日本不卡视频一二三区| 亚洲国产日韩精品| 亚洲影院在线观看| 1000精品久久久久久久久| 国产欧美精品国产国产专区| 久久影院视频免费| 欧美不卡在线视频| 8x福利精品第一导航| 欧美日本视频在线| 欧美日韩精品一区二区在线播放| 日本精品视频一区二区三区| 91啪亚洲精品| 色偷偷一区二区三区| 99国产精品久久久| 99re6这里只有精品视频在线观看| 国产suv精品一区二区883| 国产成人免费视频精品含羞草妖精| 美女爽到高潮91| 精品一区二区三区免费播放| 久久精品国产精品青草| 久久成人免费网站| 国产精品中文欧美| 成人午夜电影网站| 不卡大黄网站免费看| 99久久精品99国产精品| 一本久久综合亚洲鲁鲁五月天| 色偷偷88欧美精品久久久| 欧美性生活大片视频| 欧美久久一区二区| 欧美一区二区视频在线观看2022| 日韩欧美www| 2020国产精品| 欧美国产日韩亚洲一区| 自拍偷自拍亚洲精品播放| 夜夜嗨av一区二区三区四季av | 国产精品国产三级国产a| 国产精品久久久久久久久搜平片| 亚洲六月丁香色婷婷综合久久| 亚洲午夜一二三区视频| 日本不卡视频一二三区| 国产精品一区二区三区四区| 丁香网亚洲国际| a级高清视频欧美日韩| 欧美自拍偷拍午夜视频| 欧美精品电影在线播放| www激情久久| 亚洲欧洲精品一区二区三区不卡| 亚洲综合丁香婷婷六月香| 日本不卡视频在线观看| 国产成人午夜99999| 色综合久久天天综合网| 91精品免费观看| 日本一区二区视频在线观看| 尤物在线观看一区| 极品瑜伽女神91| 91亚洲资源网| 欧美一区二区人人喊爽| 国产精品色哟哟| 午夜影院久久久| 国产精品亚洲一区二区三区妖精| 91国产成人在线| 亚洲精品一线二线三线无人区| 国产精品美女久久久久aⅴ | 亚洲综合色区另类av| 久久国产福利国产秒拍| 99re8在线精品视频免费播放| 欧美精品xxxxbbbb| 国产精品进线69影院| 秋霞av亚洲一区二区三| 91小宝寻花一区二区三区| 精品乱人伦小说| 亚洲小少妇裸体bbw| 国产精品亚洲午夜一区二区三区| 欧美三级欧美一级| 国产精品久久久久婷婷| 奇米精品一区二区三区四区| 91丨porny丨最新| 精品国产伦一区二区三区观看体验| 亚洲精品日韩一| 国产成人精品一区二区三区网站观看| 欧美日韩在线三级| 国产精品国产三级国产普通话蜜臀| 久久精品久久综合| 欧美日韩一区视频| 日韩美女视频19| 国产精品亚洲午夜一区二区三区| 67194成人在线观看| 亚洲少妇30p| 国产高清无密码一区二区三区| 欧美二区三区91| 亚洲乱码国产乱码精品精的特点 | 国内精品嫩模私拍在线| 欧美日韩成人综合| 亚洲色欲色欲www| 不卡一区二区三区四区| 国产欧美精品一区二区三区四区| 久久精品国产一区二区三区免费看| 欧美日韩精品是欧美日韩精品| **网站欧美大片在线观看| 国产a精品视频| 26uuu国产日韩综合| 久久电影网电视剧免费观看| 日韩欧美亚洲国产精品字幕久久久| 亚洲一区二区精品3399| 日本福利一区二区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产欧美视频在线观看| 激情综合色播激情啊| 欧美变态凌虐bdsm| 美女视频一区二区三区| 精品欧美久久久| 久久精品噜噜噜成人88aⅴ| 日韩欧美国产精品| 日本不卡的三区四区五区| 日韩一区二区免费电影| 日本亚洲天堂网| 日韩视频一区在线观看| 蜜臀久久久久久久| 日韩欧美一区二区在线视频| 精品在线播放免费| 精品久久久久久久久久久久久久久 | 国产成人免费9x9x人网站视频| 国产三级精品视频| 成人性生交大合| 亚洲欧美电影一区二区| 91官网在线观看| 日韩在线观看一区二区| 欧美一区二区三区精品| 久久不见久久见免费视频7| 亚洲精品一区在线观看| 成人免费高清视频| 亚洲啪啪综合av一区二区三区| 欧美亚洲国产一区在线观看网站| 亚洲高清一区二区三区| 欧美一区二区三区思思人| 久久精品99国产国产精| 久久色在线观看| caoporn国产精品| 亚洲成人动漫av| 欧美成人精品1314www| 国产风韵犹存在线视精品| 中文字幕在线观看不卡视频| 在线免费观看成人短视频| 午夜精品久久一牛影视| 精品国产亚洲在线| 99久久免费精品| 午夜精品成人在线视频| 欧美精品一区二区三区在线播放| 国产不卡一区视频| 亚洲欧美日韩国产手机在线 | 亚洲第一成人在线| 日韩精品中文字幕在线不卡尤物 | 欧美三级日韩三级| 精彩视频一区二区| 亚洲欧洲一区二区三区| 欧美久久一二区| 成人福利视频在线| 日韩制服丝袜先锋影音| 国产精品久久久久久久久果冻传媒 | 成人性色生活片免费看爆迷你毛片| 亚洲综合av网| 国产亚洲欧美一级| 欧美日韩国产欧美日美国产精品| 精品在线你懂的| 午夜久久久久久久久| 国产精品视频一二三区| 欧美年轻男男videosbes| 国产成人av在线影院| 午夜电影一区二区| 国产精品久久久久久久久动漫| 91精品国产美女浴室洗澡无遮挡| 成人av网址在线观看| 奇米色一区二区三区四区| 亚洲精品视频一区二区| 国产欧美一区二区三区沐欲| 欧美一级艳片视频免费观看| 91免费国产在线|