# Empirical PDF from Empirical CDF

(cross post)

Suppose I do an experiment $N$ times and get a vector $X$ of results. Let $C_X(y)$ be the empirical cumulative distribution function of $X$. Suppose $X$ is sorted so that $x_1 \leq x_2 \cdots \leq x_N$. Approximately,
$C_X(y)=0\textrm{ if }y \leq x \textrm{ for all }x \in X$
$C_X(y)=1\textrm{ if }y > x \textrm{ for all }x \in X$
$C_X(y)=\frac{i+\frac{y-x_i}{x_{i+1}-x_i}}{N} \textrm{ if } x_i \leq y \leq x_{i+1}$

Question: What is the most efficient way to compute the corresponding empirical PDF of $X$? Just interpolate through the histogram?