Skip to content

Instantly share code, notes, and snippets.

@sritchie
Forked from clizzin/gist:1667186
Created January 24, 2012 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sritchie/1667190 to your computer and use it in GitHub Desktop.
Save sritchie/1667190 to your computer and use it in GitHub Desktop.
moment function for cascalog.math
(def moment
(<- [!val !k :> !moment]
(c/avg !val :> !mean)
(- !val !mean :> !dev)
(expt !dev !pow :> !pow-dev)
(c/sum !pow-dev :> !pow-dev-sum)
(div !pow-dev-sum !count :> !moment)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment