Questions tagged [kernel-density]

kernel density estimation is a non-parametric way to estimate the probability density function of a random variable.

Kernel density estimation is a fundamental data smoothing problem where inferences about the population are made, based on a finite data sample. Kernel density estimates are closely related to histograms, but can be endowed with properties such as smoothness or continuity by using a suitable kernel

http://en.wikipedia.org/wiki/Kernel_density_estimation

656 questions
9
votes
1 answer

Adaptive Bandwidth Kernel Density Estimation

There seems to be a wealth of information and tools available for the implementation of standard multivariate or univariate kernel density estimation. However, the discrete geographic data I am currently working with is especially sparse and tends…
Balthasar
  • 305
  • 4
  • 12
8
votes
1 answer

How to extract density function probabilities in python (pandas kde)

The pandas.plot.kde() function is handy for plotting the estimated density function of a continuous random variable. It will take data x as input, and display the probabilities p(x) of the binned input as its output. How can I extract the values of…
develarist
  • 1,224
  • 1
  • 13
  • 34
8
votes
3 answers

How to find Local maxima in Kernel Density Estimation?

I'm trying to make a filter (to remove outlier and noise) using kernel density estimators(KDE). I applied KDE in my 3D (d=3) data points and that gives me the probability density function (PDF) f(x). Now as we know local maxima of density estimation…
jquery404
  • 653
  • 1
  • 12
  • 26
8
votes
1 answer

Fill density curves with transparent color

I have a data frame and want to do a overlay density plot based on the two columns. I want the colors to be transparent. I have done this using the fill option and basically assigning fill to be a factor column. When you have a factor column by…
add-semi-colons
  • 18,094
  • 55
  • 145
  • 232
7
votes
2 answers

kdeplot : UserWarning: Dataset has 0 variance; skipping density estimate

While I was trying to plot a seaborn kdeplot, there was an error: UserWarning: Dataset has 0 variance; skipping density estimate I don't understand what this means. I also found that if I created a distplot for the x-axis and y-axis, there was no…
Xiang
  • 139
  • 1
  • 2
  • 8
7
votes
2 answers

What does levels mean in seaborn kde plot?

I am trying to make a contour plot of my 2d data. However, I would like to input the contours manually. I found the "levels" option in seaborn.kde documentation, where I can define the levels for contours manually. However, I have no idea what these…
MSB
  • 177
  • 2
  • 10
7
votes
0 answers

Transforming Kernel Density Estimator for non-negative observations

I am modelling the distribution of repair costs with the Kernel Density Estimator of the scikit learn package in Python. I have created the density function fitted to my observations, but when taking a random sample from this distribution negative…
7
votes
1 answer

How can I optimize the calculation over this function in numpy?

I want to implement the following problem in numpy and here is my code. I've tried the following numpy code for this problem with one for loop. I am wondering if there is any more efficient way of doing this calculation? I really appreciate…
xxx222
  • 2,980
  • 5
  • 34
  • 53
7
votes
2 answers

How do a perform a weighted, 2d kernel density estimation in R?

I would like to produce a kernel density estimation in R, and am somewhat bamboozled by all the different packages. I need to be able to: Specify weights Specify bandwidth size Specify bin size How would you go about this? Bonus points for a…
fmark
  • 57,259
  • 27
  • 100
  • 107
7
votes
1 answer

How to plot pandas kde with a horizontal orientation

Pandas offers kind='kde' when plotting. In my setting, I would prefer a kde density. The alternative kind='histogram' offers the orientation option: orientation='horizontal', which is strictly necessary for what I am doing. Unfortunately,…
cattt84
  • 941
  • 1
  • 10
  • 17
7
votes
2 answers

Gaussian kernel density smoothing for pandas.DataFrame.resample?

I am using pandas.DataFrame.resample to resample random events to 1 hour intervals and am seeing very stochastic results that don't seem to go away if I increase the interval to 2 or 4 hours. It makes me wonder whether Pandas has any type of method…
user3654387
  • 2,240
  • 4
  • 19
  • 20
7
votes
3 answers

Specifying the scale for the density in ggplot2's stat_density2d

I'm looking to create multiple density graphs, to make an "animated heat map." Since each frame of the animation should be comparable, I'd like the density -> color mapping on each graph to be the same for all of them, even if the range of the data…
jwdink
  • 4,824
  • 5
  • 18
  • 20
7
votes
1 answer

Relation between 2D KDE bandwidth in sklearn vs bandwidth in scipy

I'm attempting to compare the performance of sklearn.neighbors.KernelDensity versus scipy.stats.gaussian_kde for a two dimensional array. From this article I see that the bandwidths (bw) are treated differently in each function. The article gives a…
Gabriel
  • 40,504
  • 73
  • 230
  • 404
7
votes
1 answer

Overlay 10 density plots in R with colour proportional to number of overlapping plots

I have a dataset with 224900 observations and 10 variables which are the result of different Taylor series back transformations to original data values. I wish to overlay the density plots of each of these 10 variables to show the level of…
Michelle
  • 1,281
  • 2
  • 16
  • 31
6
votes
1 answer

Converting quartic kernel heatmap into large polygon with R

I have point data off the coast of Oahu. Someone else used those same data to create a large polygon. I believe he first created a heatmap using a quartic (biweight) kernel with a radius of 1 km around each point and perhaps a 1 km-square pixel…
Mark Miller
  • 12,483
  • 23
  • 78
  • 132
1 2
3
43 44