but is there a way to calculate a weighted average where points are given less weight when they are further from target point (for example a gaussian kernel)?
Okay, to answer my own question Iāve written an arquero window function that I believe does gaussian kernel density estimation. My stats is a little rusty, so Iād welcome any corrections in what Iāve done here!
you can see that there is a tiny difference in the last few days, where the KDE has a sharp drops, because it thinks that there are zeroes to the right of the last values ā array-blur takes the boundary into consideration.
Awesome! Thatās super cool. Yeah I noticed that drop at the end and wasnāt sure how thatās typically accounted for. Does array-blur adjust the amplitude of the kernel according to how close to the end it is (or is the calculation totally different from that? I admit I havenāt even looked at the code )
In array-blur we clamp the index to the range; in other words when you reach the end of the data vector, the missing values are taken to be the last value instead of 0. (And similarly on the left-hand side, the missing values ābefore 0ā are v[0] instead of being 0.) It happens here array-blur/blur.js at master Ā· Fil/array-blur Ā· GitHub