Click here to Skip to main content
15,915,093 members

Comments by H2O-au (Top 6 by date)

H2O-au 3-Mar-17 1:59am View    
Unwanted? No! Wanted! And intuitive! :D I find windows that only look backward to be unintuitive. When I want smoothed data, I expect a symmetrical window. I get that only-looking-back seems to be the 'standard' (e.g. it's all Excel charts will do) but personally I've never understood the statistical logic of it. Maybe people have other reasons to prefer asymmetrical windows?
H2O-au 3-Mar-17 0:50am View    
Yep, that's right, my centred window wrecks all standard tests! :D So your new results are the expected results, but skipping the first two expected elements and adding two extra elements at the end (since my function looks ahead by 2 elements).
H2O-au 3-Mar-17 0:30am View    
Looks like we're just expecting different window sizes! My parameter is a symmetric half-window, so for windows of total size 5 you need to put in 2 (i.e. current element +/- 2 elements). So try series.RollingStats(2), and you should get what you expect (offset by 2 elements).
H2O-au 26-Feb-17 11:14am View    
It looks like you're using the sum-of-squares formula for variance? Be careful of this, it tends to be numerically unstable due to catastrophic cancellation. Discovered this myself the hard way a few months back!
H2O-au 21-Jan-17 17:14pm View    
Actually, my main reason for using byte is more devious. I know my algorithm fails for numbers above 999. I couldn't be bothered going through and checking that all numbers are less than 999, so by using byte, I cover the required range but make the data integrity the caller's responsibility! ;D

I'm sure I could justify it by mumbling something about 'type safety', but I'm probably just being lazy...