densityestimation package

Submodules

densityestimation.hist module

densityestimation.hist.hist(sample)[source]

Plots a histogram based on a user specified origin and bandwidth.

Plots a histogram, a jagged density estimator, of a given sample with a user specified origin and bandwidth, after checking if the sample is valid.

ARGS:

sample: data desired to create a histogram for, entered as a one-dimensional numpy array

origin: any real number bandwidth: any number greater than 0
RETURNS:
A histogram plot is returned based on the sample given, the chosen origin and the specified bandwidth.

densityestimation.kde module

densityestimation.kde.kde(sample)[source]

Plots a kernel density estimator, kde, based on a user specified kernel and bandwidth.

Plots a kde, a denisty estimator smoothed with the use of a kernel, of a given sample with a user specified kernel and bandwidth, after checking if the sample is valid.

ARGS:
sample: data desired to create a kde for, entered as a one-dimensional numpy array
bandwidth: any number greater than 0 kernel: Gaussian (Normal), uniform, triangular, Epanechnikov
RETURNS:
A kde plot is returned based on the sample given, the type of kde desired and the specified bandwidth.

densityestimation.nnde module

densityestimation.nnde.nnde(sample)[source]

Plots a nearest-neighbor density estimator, nnde, based on a user specified k.

Plots a nnde, a density estimator smoothed by averaging distances away from k, of a given sample with a user specified k, after checking if the sample is valid.

ARGS:
sample: data desired to create a nnde for, entered as a one-dimensional numpy array
k: any real number
RETURNS:
A nnde plot is returned based on the sample given, the chosen k.

Module contents