kernel density estimation
Questions tagged [kde]
22 questions
13
votes
4 answers
Kernel density estimation incorporating uncertainties
When visualising one-dimensional data it's common to use the Kernel Density Estimation technique to account for improperly chosen bin widths.
When my one-dimensional dataset has measurement uncertainties, is there a standard way to incorporate this…

Simon Walker
- 231
- 2
- 5
13
votes
1 answer
Interpretation/use of kernel density
This may be a naive question, but here goes. If I have a set of empirical data and fit a kernel density to it, and then obtain a new single value which possibly comes from the same process which generated the original data set, can I assign a…

babelproofreader
- 4,544
- 4
- 22
- 35
12
votes
3 answers
Adaptive kernel density estimators?
Can anyone report on their experience with an adaptive kernel density estimator?
(There are many synonyms:
adaptive | variable | variable-width, KDE | histogram | interpolator ...)
Variable kernel density estimation
says "we vary the width of the…

denis
- 3,187
- 20
- 34
11
votes
4 answers
How can I estimate the density of a zero-inflated parameter in R?
I have a data set with lots of zeros that looks like this:
set.seed(1)
x <- c(rlnorm(100),rep(0,50))
hist(x,probability=TRUE,breaks = 25)
I would like to draw a line for its density, but the density() function uses a moving window that calculates…

Abe
- 3,561
- 7
- 27
- 45
11
votes
1 answer
simple sampling method for a Kernel Density Estimator
I have developed a simple Kernel Density Estimator in Java, based on a few dozen points (maybe up to one hundred or so) and a Gaussian kernel function. The implementation gives me the PDF and CDF of my probability distribution at any point.
I would…

Pierre Lison
- 771
- 6
- 17
10
votes
1 answer
Use of kernel density estimate in Naive Bayes Classifier?
This question is a follow up to my earlier question here
and is also related, in intent, to this question.
On this wiki page probability density values from an assumed normal distribution for the training set are used to calculate a Bayesian…

babelproofreader
- 4,544
- 4
- 22
- 35
7
votes
2 answers
How to smear a histogram
I was asked to perform a Gaussian smearing on the bins of an histogram. What does this mean?

Kyle Randall
- 131
- 1
- 2
4
votes
2 answers
statsmodels: error in kde on a list of repeated values
I am using Python's statsmodels module to plot a violin/bean plot of some data. I get the error "LinAlgError: singular matrix" in the KDE calculation whenever a single violin plot is drawn from a list of repeated instances of the same number. …

Ricky Robinson
- 469
- 5
- 16
3
votes
0 answers
Averaged continuous Kernel Density Estimates in lieu of a discrete Kernel Density Estimate in Monte Carlo Proceedure
I am thinking of using this code in a Monte Carlo routine to generate Kernel Density Estimates for subsequent use in a Naive Bayes Classifier (see this earlier post).
The author of the code states on the above linked page that it will "recognise…

babelproofreader
- 4,544
- 4
- 22
- 35
3
votes
0 answers
Proving the convergence of KDE algorithms when the samples are non-i.i.d
I am currently working on convergence proof for a new method for non-parametric importance sampling, and I need some help...
My method uses an MCMC algorithm to generate a set of dependent $M$ samples $X_1 \dots X_M$ from a distribution $g$, and…

Berk U.
- 4,265
- 5
- 21
- 42
3
votes
3 answers
How to estimate the mode using non-parametric methods of a 4-variate random vector drawn from a continuous multivariate distribution?
I have a sample of size 10,000 of a 4-variate random vector coming from a (unknown) continuous multivariate distribution.
How can I estimate the mode of this density using nonparametric methods?
I am currently estimating the corresponding density…

Demian
- 31
- 2
3
votes
0 answers
Estimating the non- parametric conditional probability
I have a set of observation from two parameters, let say $x$ and $y$ and then I want to make the conditional probability of $x$ for the given $y$, $p(x|y)$. So first I use scipy.stats.gaussian_kde to obtain the joint probability distribution of…

Dalek
- 205
- 6
- 18
2
votes
1 answer
Adding errors to Gaussian kernel density estimator
I'm using the scipy.stats.gaussian_kde function to generate a KDE from a set of $N$ points in a 2D space: $A = \{(x_1,y_1), (x_2,y_2), (x_3,y_2), ..., (x_N,y_N)\}$
Each one of these points has a given error attached to it. So for example, the point…

Gabriel
- 3,072
- 1
- 22
- 49
2
votes
2 answers
Confidence bounds for PDF
I build confidence bounds for estimating PDF of the empirical sample using bootstrapping:
data <- rnorm(1000)
d <- density(data)
boot <- replicate(100,
{ x <- sample(data, replace=TRUE);
density(x,…

Andy
- 383
- 1
- 2
- 10
2
votes
2 answers
kernel density estimation of a Dirichlet distribution
I have a Dirichlet distribution over the parameters of a multinomial, and I want to estimate its posterior density given some set of evidence. Due to some pecularities of my problem (e.g. presence of "soft evidence", among others), I unfortunately…

Pierre Lison
- 771
- 6
- 17