Skip to content

Instantly share code, notes, and snippets.

View edarin's full-sized avatar

Édith Darin edarin

View GitHub Profile
@edarin
edarin / kde_2d_weighted.py
Created December 5, 2016 11:27 — forked from afrendeiro/kde_2d_weighted.py
2D weighted kernel density estimation (KDE)
import numpy as np
import matplotlib.pyplot as plt
# class from here: http://nbviewer.ipython.org/gist/tillahoffmann/f844bce2ec264c1c8cb5
class gaussian_kde(object):
"""Representation of a kernel-density estimate using Gaussian kernels.
Kernel density estimation is a way to estimate the probability density
function (PDF) of a random variable in a non-parametric way.