Page 1 of 1

New statistical functions

Posted: Mon Jun 17, 2013 5:46 pm
by Janschenkel
Hi all,
My curiosity pushed me into figuring out how the built-in statistical functions were implemented (e.g. average and standardDeviation)
And then I got a bit carried away, and started implementing the functions which I had implemented in pure LiveCode earlier:
  • averageDeviation (with shorthand: avgDev)
  • geometricMean
  • harmonicMean
  • populationStandardDeviation (with shorthand: pStdDev)
And added a few synonyms for existing functions:
  • average -> arithmeticMean, mean
  • standardDeviation -> sampleStandardDeviation, sStdDev
You can check out the code in the feature-new_statistical_functions branch of my github repo.

What do you think - worthy of inclusion in LiveCode?
If so, I'll do some final tweaks for the error messages and submit a pull request?

Cheers,

Jan Schenkel.

Re: New statistical functions

Posted: Mon Jun 17, 2013 7:00 pm
by Mark
Hi Jan,

I would like to see improved matrix calculation, to allow me to estimate regression functions.

Best,

Mark

Re: New statistical functions

Posted: Mon Jun 17, 2013 7:21 pm
by Janschenkel
Update: I just added sample and population variance.
So once I've tweaked the error messages, I think it's good to go...

Jan Schenkel.

Re: New statistical functions

Posted: Mon Jun 17, 2013 7:24 pm
by Janschenkel
@Mark: I haven't yet investigated the matrix code - but once you get the hang of it, it shouldn't be too hard :-)
It's probably bed to split that off into a topic of its own on this forum, with a concrete idea, so others can chip in.

Jan Schenkel.

Re: New statistical functions

Posted: Tue Jun 18, 2013 7:02 am
by Janschenkel
Update: I tweaked the error messages and submitted pull request 74 for this set of new functions.

Cheers,

Jan Schenkel.