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
0
votes
1 answer

python: one kernel density plot which includes multiple columns in a single dataframe

I need to make a single gaussian kernel density plot of a dataframe with multiple columns which includes all columns of the dataframe. Does anyone know how to do this? So far I only found how to draw a gaussian kernel plot of a single column with…
domod
  • 1
  • 2
0
votes
1 answer

45 degree flip with 2d Normal Kernel Density

would really appreciate any help of rectifying my issue in R. I have written a KDE function in R, and I am using MASS::kde2d as my reference, to plot and model crime data. The density values I am producing seem to be in the correct range, as well…
0
votes
1 answer

kernel density function in R gives unequal x and y resolution

I hope you can help me with a problem that I've had for a while now. I need to make a bias file for MaxEnt, for which I have used this tutorial:…
Nadja
  • 3
  • 1
0
votes
1 answer

Create boundary to home range estimation (KUD)

I'm using adehabitatHR to estimate home range for penguins. Naturally, they can't swim on land, and I have been trying to add a boundary around the coastline to prevent the KUD from adding more area than is feasible. The area I'm trying to create…
Zairi
  • 31
  • 3
0
votes
1 answer

Q1: IndexError: index 1 is out of bounds for axis 1 with size 1

I'm trying to estimate the steady state distribution of piecewise probability density function using the look ahead estimator. But getting the error z[condition1] = (1/(sigma*np.sqrt(2*np.pi)…
Eric Enkele
  • 183
  • 1
  • 7
  • 17
0
votes
0 answers

How do I select data inside a density curve in R?

I have a 2 varaible data set that I have to plot (na and ob). I applied the kde2d kernel and plotted 1 to 4 sigma density curves (confidencebound). I need to select those points that are inside 2 sigma curves (letting out all those between 1 and 2…
Gargoloso
  • 1
  • 3
0
votes
0 answers

Modelling data with suitable kernel function

I would like to ask for your information what kernel type or kernels combination would fit to this data on the figure below. I used kernel ridge module from scikit-learn with this parameters: clf = KernelRidge(kernel='rbf',gamma=0.01,alpha=…
Beltrif
  • 13
  • 1
  • 10
0
votes
1 answer

Multidimensional KDE in PySpark

My goal is to fit a Kernel Density Estimate (KDE) model to a large two-dimensional dataset using either Python or PySpark, then use the fit model to predict densities for another two-dimensional dataset. I have the training data in a Spark RDD…
0
votes
2 answers

R package "mpmi" to calculate the mutual information between two set of continuous variables

I try to use the package mpmi to calculate the mutual information between two set of continuous variables. I am confused of the source code put on GutHub: https://github.com/cran/mpmi/blob/master/src/cminjk.f95 ans = ans + log(s12(i) / (s1(i) *…
S.C. Jiang
  • 21
  • 3
0
votes
1 answer

Can I rotate a graph and plot it on the y axis?

I want to plot my points on a graph and then show the density distribution on the x-axis and on the y-axis at the same time. I'm able to do it on the x axis but not on the y axis.…
M. Beausoleil
  • 3,141
  • 6
  • 29
  • 61
0
votes
1 answer

color overlapping lines in plot based on density

I've got a large dataset of a time series that I'd like to plot with lines indicating values across the time points. Example: df.test=data.frame(runif(1000),runif(1000),runif(1000)*2,runif(1000)/2) matplot(t(df.test),type="l",col="black") I would…
desc
  • 1,190
  • 1
  • 12
  • 26
0
votes
0 answers

When using kdeplot on a seaborn PairGrid, the kernel density contours don't match up with the points

my problem can be summed up by the plots at the bottom of this post. They show progressive zooming in of the buggy pairgrid, with the key plots being on the left column. Essentially, the points in my pairgrid are annoyingly very scattered, however…
Marses
  • 1,464
  • 3
  • 23
  • 40
0
votes
0 answers

density plot and scipy gaussian kernel

I have two 1-D arrays of coordinates x and y and I would'l to have a density plot. I found that scipy.stats.gaussian_kde() could help me, but I don't undestand how it really work. My code is: n = 1000 xs, ys = np.random.normal(-3., 3., size=n),…
0
votes
1 answer

The optimal grid size for 2D kernal density distribution in R

I am generating 2D kernal density distributions for every pair of numeric columns in a data set, using kde2d function in the MASS package. This takes the following parameters: kde2d(x, y, h, n=25, lims = c(range(x), range(y))) where n is the…
Harry
  • 65
  • 1
  • 5
0
votes
1 answer

How to 3D plot matrices that are not squared in R?

I would like to plot a heatmap using my own mathematical function instead of the Kernel density estimation. But for the moment my problem comes from the fact that I cannot 3D plot this function using persp() if my x & y axes are not squared. Indeed…