I have a set of finite variables (~20) which when plotted are forming a decaying exponential function. I want to know is there a better way to calculate the average of this function than by just averaging its value at these 20 points.
I know mean is { f(x1)+f(x2)+ ............... +f(x20)}/20
But I would like to know if there is a better way.
Any help would be appreciated
Mean of a continuous function with a discrete set of values is usually approximated with rectangle method, midpoint method or trapezoid method.
The best way is usually trapezoid, which is calculated as : $$\frac{1}{x_n-x_0}\sum_{k=0}^{n-1}\frac{x_{k+1}-x_k}{2}(f(x_k)+f(x_{k+1}))$$