Menu

#678 Average deviation function

closed-fixed
nobody
None
5
2020-07-20
2019-05-09
No

The Ops class currently has variance and standard deviation functions. It would be nice to have the two average deviation functions as well:

AvDev_mean = sum(abs(x_i - mean(x))) / N
AvDev_median = sum(abs(x_i - median(x))) / N

Numerical Recipies' chapter on stats gives a reason or two why these values can sometimes be more useful than the standard deviation.

For efficiency reasons, it would be nice if the functions could calculate and return both the average deviation and the mean/median at the same time, but that's just my inner IDL speaking.

Discussion

  • Jeremy Faden

    Jeremy Faden - 2019-05-10

    I've added mad, and it puts the mean and number of points (n) in USER_PROPERTIES.

     

    Last edit: Jeremy Faden 2019-05-10
  • Jeremy Faden

    Jeremy Faden - 2019-05-26

    I finally changed the name "mad" to "meanAverageDeviation". This had been bugging me because (1) I don't think a short name is really needed (it will be used in assignments but not expressions), because this is self-documenting, and last because I discovered there's also a medianAverageDeviation. (This is the median of the deviations, not the mean of the deviations from the median.)

     
  • Jeremy Faden

    Jeremy Faden - 2020-07-20
    • status: open --> closed-fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.