TL; DR If you have a unimodal distribution of values, you can use R’s density or Scipy’s gaussian_kde to create density estimates of the data, and then take the maxima of the density estimate to get the mode. See below for actual examples in R and Python.
Mode in R First, lets do this in R. Need some values to work with.
library(ggplot2) set.seed(1234) n_point <- 1000 data_df <- data.

© 2017 Robert M Flight ·
Powered by
Blogdown, and the
Academic theme for
Hugo.

The source of this site is available from here. The content from my previous site

is all here, in case I haven't posted something on the new one.