From: Chuck Remes Date: 2009-07-22T02:02:32+09:00 Subject: Re: Mean method On Jul 21, 2009, at 10:30 AM, Älphä Blüë wrote: > I adjusted the code a bit to handle the size factor with @size in > initialize (code changed if you refresh pastie). > > My main use is really for arrays but I like making things modular and > useful. I'm almost finished with the standard deviation class which > includes mean.. > > I perform a lot of advanced mathematics and statistical analysis so I > need some heavier methods here and there.. > > As I'm still new to ruby this is a great lesson for me as well, > especially with regards to code polishing and adapting to rubyism code > writing. I've written some code to compute skew and kurtosis (the 3rd and 4th moments) if you want a copy. I'll send you my whole class if you'd like. It's a bit hard to follow because I heavily optimized it to cache results and/or pass around intermediate results. cr