3 ms·
Simpson's rule is a more accurate approach to numerical integration without being more computationally expensive: https://en.wikipedia.org/wiki/Simpson%27s_rule
by mahathu 5y ago
Simpson's rule is a more accurate approach to numerical integration without being more computationally expensive: https://en.wikipedia.org/wiki/Simpson%27s_rule https://en.wikipedia.org/wiki/Simpson%27s_rule
Nevertheless, this was a very interesting article! When the topic of a time-weighted average came up, my first intuition was to give each sample y_n a weight of x_n - x_n-1, that is, the distance/time to the sample that came before. Wouldn't that also suffice?
- djk447 5y agoNB: Article author here. Interesting idea with Simpson's rule! Perhaps we'll add another method... The other approach is very similar to the LOCF (last observation carried forward) approach, except that it uses the distance to the next sample instead of distance to the previous. I'm sure there are reasons to do the other way, but for most things that use LOCF they record when the value changes so it makes more sense to carry it forward. And it works pretty well as well. These are all also other integral approximation techniques, and which to use probably depends mostly on use case.