?? importanceweights.m
字號:
function q = importanceweights(xu,y,R);% PURPOSE : Computes the normalised importance ratios for the % model described in the file sirdemo1.m.% INPUTS : - xu = The predicted state samples.% - y = The output measurements.% - R = The measurement noise covariance.% OUTPUTS : - q = The normalised importance ratios.% AUTHOR : Nando de Freitas - Thanks for the acknowledgement :-)% DATE : 08-09-98if nargin < 3, error('Not enough input arguments.'); end[rows,cols] = size(xu);q = zeros(size(xu));m = (xu.^(2))./20;for s=1:rows, q(s,1) = exp(-.5*R^(-1)*(y- m(s,1))^(2))./sum(exp(-.5*R^(-1)*(y.*ones(size(xu))-m).^(2)));end;subplot(224); plot(xu,q,'+') ylabel('Likelihood function','fontsize',15);xlabel('Hidden state support','fontsize',15)axis([-30 30 0 0.03]);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -