I have a dataset $D = \{(x_i, y_i)\}_{i=1...N}$ and I would like to estimate the expected value of a continuous function $r(x,f)$ given only an $x$, where $f=\frac{y}{x}$. The expectation here would be over the distribution of $f$ $$ \mathop{\mathbb{E}}_{f \sim p(f)} [r(x, f)] $$ If I say that the empirical density of $f$ based on $D$ is $$ p_{emp}(f) = \frac{1}{N} \sum_{i=1}^N \delta(f_i - f) $$ then the above expectation becomes a sum over $r(x, f_i)$ evaluated at the ratios $f_i = \frac{y_i}{x_i}$.
The question I struggle to answer arises when wanting to bin the data, for example when $N$ is too large to evaluate the sum over all $f_i$ for each new $x$.
The question is: what is my $f$-value for each bin? Is it the midpoint, the mean of the $f$-values falling into the bin, the median, or something else?
Please forgive the poor notation, I have no formal mathematics training, only what I have from studies in physics. Any clarification on notation, terminology would be much appreciated.