When using mdev, I was producing a number of unexpected nulls. It seemsthat the definition is based on sqrt(avg(x^2) - avg(x)) without checkingthat the difference is non-negative before taking the square root.Example:q)5 mdev 10#1e-30 0 0 0 0 0 0 0 0n 0nIs there any reason not to change the definition of mdev from{sqrt mavg[x;y*y]-m*m:mavg[x;y:“f”$y]}to{sqrt 0f|mavg[x;y*y]-m*m:mavg[x;y:“f”$y]} ?Josh
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
mdev function | 11 | 0 | November 27, 2016 | |
Moving Deviation mdev - not working | 3 | 0 | January 9, 2012 | |
Standard Deviation(dev) bug in kdb/q 3.2? | 5 | 0 | January 26, 2015 | |
standard deviation query from jdbc | 3 | 0 | November 8, 2011 | |
-0f | 5 | 0 | November 23, 2020 |