Does anyone know where I can find methods for statistics, like standard deviation?
Regression would be nice also. Sincerely, Joe. |
Find with "dhb numerical method" or something on google.
Sent from my iPhone On Nov 15, 2012, at 5:12, Joseph J Alotta <[hidden email]> wrote: > Does anyone know where I can find methods for statistics, like standard deviation? > > Regression would be nice also. > > Sincerely, > > Joe. > > > |
The package is based on Didier Besset's book "Object-Oriented Implementation of Numerical Methods". The code is available as a Monticello package on squeaksource (http://www.squeaksource.com/DHBNumerical).
HTH Doug On Nov 14, 2012, at 13:54 , Sungjin Chun wrote: > Find with "dhb numerical method" or something on google. > > Sent from my iPhone > > On Nov 15, 2012, at 5:12, Joseph J Alotta <[hidden email]> wrote: > >> Does anyone know where I can find methods for statistics, like standard deviation? >> >> Regression would be nice also. >> >> Sincerely, >> >> Joe. >> >> >> > |
In reply to this post by Sungjin Chun
You could check https://github.com/SergeStinckwich/SciSmalltalk too
which should include dhb numerics. If that does not fit, maybe think of capitalizing there... Nicolas 2012/11/14 Sungjin Chun <[hidden email]>: > Find with "dhb numerical method" or something on google. > > Sent from my iPhone > > On Nov 15, 2012, at 5:12, Joseph J Alotta <[hidden email]> wrote: > >> Does anyone know where I can find methods for statistics, like standard deviation? >> >> Regression would be nice also. >> >> Sincerely, >> >> Joe. >> >> >> > |
Why don't you use the SqueakSource repository for DHB Numerical Methods?
Hernán El 14/11/2012 19:11, Nicolas Cellier escribió: > You could check https://github.com/SergeStinckwich/SciSmalltalk too > which should include dhb numerics. > If that does not fit, maybe think of capitalizing there... > > Nicolas > > 2012/11/14 Sungjin Chun <[hidden email]>: >> Find with "dhb numerical method" or something on google. >> >> Sent from my iPhone >> >> On Nov 15, 2012, at 5:12, Joseph J Alotta <[hidden email]> wrote: >> >>> Does anyone know where I can find methods for statistics, like standard deviation? >>> >>> Regression would be nice also. >>> >>> Sincerely, >>> >>> Joe. >>> >>> >>> >> > > |
In reply to this post by Joseph Alotta
I looked at the repositories that you mention and there is nothing there that I can work with. It is this very vast
collection of code that has no documentation and no description. There seems to be methods for standard deviation but it involves subtracting moments from a larger object that calculated it somehow and is not to be found. It seems that one needs a vast understanding of the inner workings of smalltalk to use these classes. I was under the impression that knowledge of the hacky things is supposed to be hidden from a casual user or at least this is the design principle that is not followed. It is funny to me that there is not a simple answer to a simple question like this and I am left to coding standard deviation for myself. > On Nov 15, 2012, at 5:12, Joseph J Alotta <[hidden email]> wrote: > >> Does anyone know where I can find methods for statistics, like standard deviation? >> >> Regression would be nice also. >> >> Sincerely, >> >> Joe. |
You can consult this book "Object-Oriented Implementation of Numerical Methods" for the code, especially Dhb... classes.
On Fri, Nov 16, 2012 at 9:30 AM, Joseph J Alotta <[hidden email]> wrote: I looked at the repositories that you mention and there is nothing there that I can work with. It is this very vast |
You could try the following, assuming your data is in a collection called "data".
standardDeviation | accumulator | accumulator := DhbStatisticalMoments new. data do: [:each | accumulator accumulate: each]]. ^accumulator standardDeviation Also, see the tests in DhbNumericalMethodsTestCase. DhbNumericalMethodsTestCase>>testStatisticalMoments DhbNumericalMethodsTestCase>>testStatisticalMomentsFast HTH On Nov 15, 2012, at 16:34 , Sungjin Chun wrote: You can consult this book "Object-Oriented Implementation of Numerical Methods" for the code, especially Dhb... classes. |
In reply to this post by Joseph Alotta
I add these two methods to the math functions protocol of the Collections class:
variance ^(self - self average) squared average and standardDeviation ^self variance sqrt. Be careful with large collections integers as these methods will invoke fraction arithmetic which is rather slow. In most cases it would be better to force floating point. |
2012/12/5 glenpaling <[hidden email]>:
> I add these two methods to the math functions protocol of the Collections > class: > > variance > > ^(self - self average) squared average > > and > > standardDeviation > > ^self variance sqrt. > > Be careful with large collections integers as these methods will invoke > fraction arithmetic which is rather slow. In most cases it would be better > to force floating point. > > No, IMO the library shouldn't force anything but let the decision to the sender. Such information has a place in documentation. Nicolas > > -- > View this message in context: http://forum.world.st/statistics-standard-deviation-tp4655159p4658151.html > Sent from the Squeak - Dev mailing list archive at Nabble.com. > |
On 5 December 2012 17:38, Nicolas Cellier
<[hidden email]> wrote: > 2012/12/5 glenpaling <[hidden email]>: >> I add these two methods to the math functions protocol of the Collections >> class: >> >> variance >> >> ^(self - self average) squared average >> >> and >> >> standardDeviation >> >> ^self variance sqrt. >> >> Be careful with large collections integers as these methods will invoke >> fraction arithmetic which is rather slow. In most cases it would be better >> to force floating point. >> >> > > No, IMO the library shouldn't force anything but let the decision to the sender. > Such information has a place in documentation. Especially when forcing floats is as easy as (myCollection collect: #asFloat) standardDeviation. frank > Nicolas > >> >> -- >> View this message in context: http://forum.world.st/statistics-standard-deviation-tp4655159p4658151.html >> Sent from the Squeak - Dev mailing list archive at Nabble.com. >> > |
In reply to this post by Nicolas Cellier
Yes, that was my intention. The methods are generic.
Are these worth adding to the image? I can submit them to the inbox, with tests of course. |
Free forum by Nabble | Edit this page |