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

Plotting density function of propensity score before matching

I'm running a dif-in-dif estimation and using the MatchIt package to match my treatment and control groups by their distance to a certain location (nearest neighbour matching, logit model, caliper = 0.25). Everything is ok with the actual matching,…
0
votes
0 answers

two extreme cases in choosing bandwidth parameter in kernel estimator

In kernel estimator, we have to choose h parameter as a bandwidth of the kernel, I know that there are methods to choose the parameter h. Also, there are two extreme cases on choosing h, if we choose h to tend to zero this will lead to the nearest…
0
votes
0 answers

How to get the analytical formula from kernel estimator in Matlab

I am using the ksdensity function, which objective is to ive an kernel estimator for a probability density function. This kernel estimator is continous and given by the sum of simple functions. Matlab gives me the value of the kernel at a…
Pierre
  • 1
0
votes
1 answer

Assigned legend colors don't work/show

I'm fairly new to R. I'm trying to create a density plot, which wasn't problem thanks to previous questions & answers here. My current problem is the graphs's legend. I've assigned the wanted colors (col = c("red", "orange", "yellow", "green",…
Keity
  • 143
  • 1
  • 10
0
votes
0 answers

kernel density with weighted observations in r

I have coordinates of road accident data and I want to use 2d kernel density with weighted observation by severity of accident: For example, I want fatal accident to be counted 3 times and damage only accident to be counted 1 time. How do I add it…
NOA11120
  • 27
  • 5
0
votes
1 answer

Filter function for High Dimensional Data in TDAmapper in R

I would like to use R TDAmapper package to represent my dataset with 76 rows and 316 columns. I'm following this code: http://bertrand.michel.perso.math.cnrs.fr/Enseign but the filter function used, Kernel function kde, is not good for my case…
Katherina
  • 45
  • 1
  • 7
0
votes
2 answers

Re-using SparkContext object in UDAF

I am trying to implement an aggregated version of org.apache.spark.mllib.stat.KernelDensity to estimate the Probably Density Function of multiple distributions concurrently. The idea is to have a data frame with say 2 columns: one for the name of…
0
votes
1 answer

Estimate and extract point values from a 3D kernel density in R

From the following code in the R documentation link I would like to figure out how to extract a single value ("density") for each of the original points of a data frame This, so that I can use the new column for further applications that i have in…
Mark
  • 2,789
  • 1
  • 26
  • 66
0
votes
1 answer

2D Density Contour Plot with KDE instead of histogram in plotly

Hi all: I would like to draw kernel density instead of histograms in 2D Density Contour Plot using R plotly. Could anyone help me, please? Below are my data and code. g <-c("Pla", "Ond","Gra", "Dol","Tro", "Ond+Dex", "Pal","Ram", "Ond+Drop", …
Krantz
  • 1,424
  • 1
  • 12
  • 31
0
votes
1 answer

Pandas - Filtering text and data

We have just learnt how to filter through some pandas in Python so I thought I would try this out on a public data set. (http://data.wa.aemo.com.au/#stem-bids-and-offers) I used August's data for this. The challenge I set myself was to filter ONLY…
IronKirby
  • 708
  • 1
  • 7
  • 24
0
votes
1 answer

R: how to obtain specific density estimates

# The Old Faithful geyser data d <- density(faithful$eruptions, bw = "sj") > head(d$x) [1] 1.179869 1.188363 1.196857 1.205350 1.213844 1.222338 I'm using density function in {stats}, and I'm wondering if it's possible to see density at specific…
Adrian
  • 9,229
  • 24
  • 74
  • 132
0
votes
1 answer

How to get Kernels from kernel density estimation (preferrably sklearn.neighbors)?

I'm currently working on some seasonality estimation for a time series dataset. What I get is a dataset of possible frequencies/periods that might occur in the dataset. Thus, this is somewhat noisy (e.g. having some periods as [100, 98, 101, 102]…
Ben Müller
  • 125
  • 1
  • 11
0
votes
1 answer

Scaleable Python normal distribution from pandas DataFrame

I have a pandas dataframe (code below) that has the mean and std deviation by day of week and quarter. What i'd like to do is extract each mean and std deviation by day of week, create a random normal sample from those two values then plot…
P.Cummings
  • 101
  • 1
  • 1
  • 9
0
votes
0 answers

Visualizing difference between two distributions

I am trying to visualize the differences between two distributions (preferably using python). I've plotted the cumulative frequency distributions as well as kernel density estimates: kde, cumulative frequency But, my audience is not used to looking…
0
votes
1 answer

Plotting the reflection (i.e., shadow) of a histogram in R (code and visual provided)

I was wondering if I could plot the reflection of my "Density Histogram" (i.e., shadow [as shown in "blue" in the below picture]) in (possibly) "Base" R? Please see my R code below the picture. Here is my R code: set.seed(0) ; x = rnorm(n = 1e4) …
rnorouzian
  • 7,397
  • 5
  • 27
  • 72