Using approximate nearest neighbour for density estimation