oldnewbird的个人博客分享 http://blog.sciencenet.cn/u/oldnewbird

博文

高斯核密度估计方法代码

已有 7000 次阅读 2019-10-24 22:09 |个人分类:代码分享|系统分类:科研笔记| matlab, 密度估计, 高斯核

function weight_new = kernel_density_estimation(X,particles,weight)


% clear all

% close all

% clc

% particles = [normrnd(-2,1,[1,100]),normrnd(2,1,[1,100])];

% weights = ones(1,200)/200;

% X = particles;


[a,b] = size(X);

if nargin<3

    weight = ones(1,b)/b;

end

weight_new = zeros(1,b);

for i = 1:b

    weight_new(i) = sum(mvnpdf(particles',X(:,i)',0.4*eye(a)).*weight');

end




https://blog.sciencenet.cn/blog-3421825-1203327.html

上一篇:mysvmtrian
下一篇:Matlab 生成随机数大全
收藏 IP: 219.239.227.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-24 02:24

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部