资源简介
matlab最快最强的核密度估计代码,容易上手
代码片段和文件信息
function [bandwidthdensityXY]=kde2d(datanMIN_XYMAX_XY)
% fast and accurate state-of-the-art
% bivariate kernel density estimator
% with diagonal bandwidth matrix.
% The kernel is assumed to be Gaussian.
% The two bandwidth parameters are
% chosen optimally without ever
% using/assuming a parametric model for the data or any “rules of thumb“.
% Unlike many other procedures this one
% is immune to accuracy failures in the estimation of
% multimodal densities with widely separated modes (see examples).
% INPUTS: data - an N by 2 array with continuous data
% n - size of the n by n grid over which the density is computed
% n has to be a power of 2 otherwise n=2^ceil(log2(n));
% the default value is 2^8;
% MIN_XYMAX_XY- limits of the bounding box over which the density is computed;
% the format is:
% MIN_XY=[lower_Xlimlower_Ylim]
% MAX_XY=[upper_Xlimupper_Ylim].
% The dafault limits are computed as:
% MAX=max(data[]1); MIN=min(data[]1); Range=MAX-MIN;
% MAX_XY=MAX+Range/4; MIN_XY=MIN-Range/4;
% OUTPUT: bandwidth - a row vector with the two optimal
% bandwidths for a bivaroate Gaussian kernel;
% the format is:
% bandwidth=[bandwidth_X bandwidth_Y];
% density - an n by n matrix containing the density values over the n by n grid;
% density is not computed unless the function is asked for such an output;
% XY - the meshgrid over which the variable “density“ has been computed;
% the intended usage is as follows:
% surf(XYdensity)
% Example (simple Gaussian mixture)
% clear all
% % generate a Gaussian mixture with distant modes
% data=[randn(5002);
% randn(5001)+3.5 randn(5001);];
% % call the routine
% [bandwidthdensityXY]=kde2d(data);
% % plot the data and the density estimate
% contour3(XYdensity50) hold on
% plot(data(:1)data(:2)‘r.‘‘MarkerSize‘5)
%
% Example (Gaussian mixture with distant modes):
%
% clear all
% % generate a Gaussian mixture with distant modes
% data=[randn(1001) randn(1001)/4;
% randn(1001)+18 randn(1001);
% randn(1001)+15 randn(1001)/2-18;];
% % call the routine
% [bandwidthdensityXY]=kde2d(data);
% % plot the data and the density estimate
% surf(XYdensity‘Linestyle‘‘none‘) view([060])
% colormap hot hold on alpha(.8)
% set(gca ‘color‘ ‘blue‘);
% plot(data(:1)data(:2)‘w.‘‘MarkerSize‘5)
%
% Example (Sinusoidal density):
%
% clear all
% X=rand(10001); Y=sin(X*10*pi)+randn(size(X))/3; data=[XY];
% % apply routine
% [bandwidthdensityXY]=kde2d(data);
% % plot the data and the density estimate
% surf(XYdensity‘Linestyle‘‘none‘) view([070])
% colormap hot hold on alpha(.8)
% se
- 上一篇:MATLAB下求两幅图像的峰值信噪比PSNR
- 下一篇:Matlab图像分割法
相关资源
- 自适应核密度估计MATLAB源代码
- matlab混合高斯背景建模
- 高斯-赛德尔迭代法计算公式 matlab
- 高斯加性噪声信道模型的matlab模拟
- 多尺度高斯模型的图像色彩增强
- MATLAB-高斯核密度估计
- 高斯混合模型GMM 及高斯混合回归MAT
- 20M带宽高斯信道 Matlab 仿真
- 二维混合高斯分布的EM算法matlab
- 用MATLAB编写的高斯脉冲
- matlab高斯-塞德尔迭代法
- 高斯多峰拟合
- 添加椒盐和高斯噪声的MATLAB代码
- 有高斯噪声的RSSI值仿真代码
- 基于混合高斯模型的图像分割方法
- 电力系统潮流计算高斯-赛德尔迭代法
- 高斯-拉盖尔积分Gauss-laguerre积分matl
- 杂波程序matlab
- 产生正弦波、均匀白噪声、高斯白噪
- 高斯过程回归GPR MATLAB
- 高斯混合模型说话人识别
- 快速可靠的噪声估计程序(matlab程序
- Matlab 广义高斯分布建模
- 核密度估计大作业KDE
- 构造均值为a方差为b的高斯白噪声
- 一维高斯随机粗糙面建模.zip
- matlab正弦信号高斯处理
- 多种核函数的SVM分类器matlab程序
- sigama 自适应高斯滤波器 matlab 程序
- matlab 高斯过程回归模型 matlab Gaussia
评论
共有 条评论