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 | 31 | November 27, 2016 | |
| Moving Deviation mdev - not working | 3 | 10 | January 9, 2012 | |
| select avg (ignore null) | 6 | 24 | June 30, 2022 | |
| select avg (ignore null) | 4 | 13 | June 30, 2022 | |
| Standard Deviation(dev) bug in kdb/q 3.2? | 5 | 15 | January 26, 2015 |