histweight

版本 1.0.1 (372.2 KB) 作者: andrepiz
HISTWEIGHT bins scattered data points defined in any dimension weighting them into uniform bins of specified granularity.
11.0 次下载
更新时间 2024/2/7

HISTWEIGHT bins scattered data points defined in any dimension weighting them into uniform bins of specified granularity. Each data point has an associated intensity value which is spread to the neighbouring bins with a weight defined by three different methods (invsquared, diff or area). Limits of binning can be defined, different for each dimension. The granularity downsample the limits and increase the number of bins.

Examples of how the function works are depicted in the following figure. Granularity is set to 1 and area method is used for all of them.

  • 1-dimensional uniform points sampled from a sine wave with decreasing amplitude: sine_uniform
  • 2-dimensional random points with two different intensities: points_random
  • 2-dimensional random points sampled within a circle, with a larger intensity in a inner circle: circle_random
  • 3-dimensional uniform points sampled within a emisphere, with intensity increasing with the radius: emisphere_uniform

WHY HISTWEIGHT? The MATLAB function histcounts allows to bin scattered data points into quantiles and counts the number of points falling into each quantile. HISTWEIGHT improves histcounts by considering intensity values for each data point that are spread across the neighbouring quantiles. Note that in this way energy conservation is respected as the total sum of the intensity values associated to each point is equal to the total sum of the intensity values associated to each bin. This does not happen with MATLAB histcounts. THe following figures show a comparison of HISTWEIGHT against MATLAB histcounts using three different methods for a set of 10 randomly distributed points:

  • invsquared: inverse squared distance of each vertex with respect to the center of the bin invsquared
  • diff: 1 minus distance of each vertex with respect to the center of the bin, normalized over maximum distance diff
  • area: fractions of a square box centered into the point that fall into each neighbouring bins area

引用格式

andrepiz (2024). histweight (https://github.com/andrepiz/histweight), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2023b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!

无法下载基于 GitHub 默认分支的版本

版本 已发布 发行说明
1.0.1

Added examples for 1d, 2d and 3d case.

1.0.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库