adaptive kernel density estimation in one-dimension

版本 1.0.0.0 (3.7 KB) 作者: Zdravko Botev
fast and reliable adaptive kernel density estimator
751.0 次下载
更新时间 2016/7/21

查看许可证

Fast adaptive kernel density estimation in one-dimension in one m-file;
Provides optimal accuracy/speed trade-off. To increase speed when dealing with "big data",
simply reduce the "gam" parameter; Typically "gam=n^(1/3)", where "n" is the length of data.

% [pdf,grid]=akde1d(X,grid,gam)
INPUTS:
X - data as a 'n' by '1' vector;
grid - (optional) mesh over which density is to be computed;
default mesh uses 2^12 points over range of data;
gam - (optional) cost/accuracy trade-off parameter, where gam<n;
default value is gam=ceil(n^(1/3))+20; larger values
result in better accuracy, but reduce speed;
to speedup the code, use smaller "gam";

OUTPUT:
pdf - the value of the estimated density at 'grid'

EXAMPLE:
data=[exp(randn(10^3,1))]; % log-normal sample
[pdf,grid]=akde1d(data); plot(grid,pdf)

Note: If you need a very fast estimator use my "kde.m" function.
This routine is more adaptive at the expense of speed. Use "gam" to control a speed/accuracy tradeoff.

Reference:
Kernel density estimation via diffusion
Z. I. Botev, J. F. Grotowski, and D. P. Kroese (2010)
Annals of Statistics, Volume 38, Number 5, pages 2916-2957.

引用格式

Zdravko Botev (2024). adaptive kernel density estimation in one-dimension (https://www.mathworks.com/matlabcentral/fileexchange/58309-adaptive-kernel-density-estimation-in-one-dimension), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Wavelet Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0