statistics: standard deviation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

statistics: standard deviation

Joseph Alotta
Does anyone know where I can find methods for statistics, like standard deviation?

Regression would be nice also.

Sincerely,

Joe.



Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Sungjin Chun
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.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

douglas mcpherson
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.
>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Nicolas Cellier
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.
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

hernanmd
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.
>>>
>>>
>>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Joseph Alotta
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.

Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Sungjin Chun
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
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.




Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

douglas mcpherson
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.


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
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.






Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

glenpaling
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.
Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Nicolas Cellier
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.
>

Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

Frank Shearar-3
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.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: statistics: standard deviation

glenpaling
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.