Probabilities package for Pharo?

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

Probabilities package for Pharo?

Sebastian Tleye
Hi, 

I am doing some experiments in Pharo and I need to model Normal and Log-Normal distributions in pharo. 
Is there any existing package for that?

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Probabilities package for Pharo?

Markus Fritsche-4
On 2014-04-24 11:10, Sebastian Tleye wrote:

> Hi,
>
> I am doing some experiments in Pharo and I need to model Normal and
> Log-Normal distributions in pharo.
> Is there any existing package for that?

Hello Sebastion,

have you tried the "NumericalMethods" Package in the Configuration
browser? It loads a package "DHB", which includes the class
DhbNormalDistribution.


Best regards,
   Markus

Reply | Threaded
Open this post in threaded view
|

Re: Probabilities package for Pharo?

Sebastian Tleye
Thanks Markus, I didn't try it but I will!


2014-04-24 11:20 GMT+02:00 Markus Fritsche <[hidden email]>:
On 2014-04-24 11:10, Sebastian Tleye wrote:

Hi,

I am doing some experiments in Pharo and I need to model Normal and Log-Normal distributions in pharo.
Is there any existing package for that?

Hello Sebastion,

have you tried the "NumericalMethods" Package in the Configuration browser? It loads a package "DHB", which includes the class DhbNormalDistribution.


Best regards,
  Markus


Reply | Threaded
Open this post in threaded view
|

Re: Probabilities package for Pharo?

Henrik Sperre Johansen

On 24 Apr 2014, at 11:25 , Sebastian Tleye <[hidden email]> wrote:

Thanks Markus, I didn't try it but I will!


2014-04-24 11:20 GMT+02:00 Markus Fritsche <[hidden email]>:
On 2014-04-24 11:10, Sebastian Tleye wrote:

Hi,

I am doing some experiments in Pharo and I need to model Normal and Log-Normal distributions in pharo.
Is there any existing package for that?

Hello Sebastion,

have you tried the "NumericalMethods" Package in the Configuration browser? It loads a package "DHB", which includes the class DhbNormalDistribution.


Best regards,
  Markus


If the package is anything like the one in VisualWorks (In other words, LogNormalDistribution a subclass of ProbabilityDensityWithUnknownDistribution), you probably want to implement
LogNormalDistribution >> distributionValue: aNumber
"Answers the probability of observing a random variable distributed according to
the receiver with a value lower than or equal to aNumber."
^aNumber > 0 
ifFalse: [0]
ifTrue: [normalDistribution distributionValue: aNumber ln]

rather than rely on the supers implementation, if you plan on using it.

Cheers,
Henry

signature.asc (859 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Probabilities package for Pharo?

Sebastian Tleye
Thanks Henrik, I'll take it into account.


2014-04-24 12:58 GMT+02:00 Henrik Johansen <[hidden email]>:

On 24 Apr 2014, at 11:25 , Sebastian Tleye <[hidden email]> wrote:

Thanks Markus, I didn't try it but I will!


2014-04-24 11:20 GMT+02:00 Markus Fritsche <[hidden email]>:
On 2014-04-24 11:10, Sebastian Tleye wrote:

Hi,

I am doing some experiments in Pharo and I need to model Normal and Log-Normal distributions in pharo.
Is there any existing package for that?

Hello Sebastion,

have you tried the "NumericalMethods" Package in the Configuration browser? It loads a package "DHB", which includes the class DhbNormalDistribution.


Best regards,
  Markus


If the package is anything like the one in VisualWorks (In other words, LogNormalDistribution a subclass of ProbabilityDensityWithUnknownDistribution), you probably want to implement
LogNormalDistribution >> distributionValue: aNumber
"Answers the probability of observing a random variable distributed according to
the receiver with a value lower than or equal to aNumber."
^aNumber > 0 
ifFalse: [0]
ifTrue: [normalDistribution distributionValue: aNumber ln]

rather than rely on the supers implementation, if you plan on using it.

Cheers,
Henry