Fusion of Math-Random and Math-DHB-Numerical packages

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

Fusion of Math-Random and Math-DHB-Numerical packages

SergeStinckwich
Hi all,

I start to work on the fusion of Math-Random and Math-DHB-Numerical packages.
Some distributions are implemented in both packages.
The distributions in DHB do not follow the standard Random API like
next/peek and there is not tests ... Math-Random have tests, and
implement many RNG.

I already transfer one test from ExponentialGeneratorTest to
DHBExponentialDistributionTest.
More work need to be done ;-)

Regards,

--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Fusion of Math-Random and Math-DHB-Numerical packages

werner kassens-2
Hi Serge,
when fusioning both things, it would perhaps also make sense to add the possibility to plug into dhb other uniform generators like MarsagliaKissRandomKernel so that eg this one will be used by dhb to produce its randomnumbers of other distributions etc. one could for example make a DhbStandardRandomgenerator that produces a unique instance and has a class method #setUniformGenerator: or so and then will be used wherever DHMitchellMoreGenerator is used. i dont remember anymore who this proposed but somebody mentioned this idea some time ago.

re standard Random API:

are next/peek the only standard things?

in dhb #random is the same as #next, but it has more uses than next usually:
eg '2 random.' produces 0 or 1, or '2.0 random' produces 0<=result<2, something i find very practical. but i guess '2 next' is somewhat counterintuitive, or? <g> i would expect the result to be 3. iow simply replacing #random by #next, i'm not so sure, are you? and since with the ProbabilityDensities  you could eg do 'DhbNormalDistribution new random', is 'DhbNormalDistribution new next' really very intuitive? 

implementing #peek in the two randomnumbergenerators of dhb is very simple (apart from the fact that on the low level of the randomnumbergenerators itself, there does not exist #random but #floatValue and #integerValue:, i guess one does not need a #integerPeek: - probably) but implementing that on the distribution-side would probably be complicated. i guess one could not simply implement it in the superclass DhbProbabilityDensity. and if one does it for each ProbabilityDensity separately one would run _at least_ into the problem that occasionally one needs to peek at least at the next _two_ numbers (this is the reason why eg the GaussianGenerator in Math-Random has no #peek). and that is in a way a problem. if it would be no problem than one could probably implement it in DhbProbabilityDensity but one would need to complicate the interface of DhbProbabilityDensity and its subclasses somewhat. but one would probably need to do that anyway if one does not want to replicate a lot of code for #peek in every density.

and for the possibility to plug randomgenerators into dhb, one would of course need a standardized interface iow either #next or #random. and a few other things like a dhbstandardgenerator needs to calc randomintegers for things like '2 next'.
werner

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Fusion of Math-Random and Math-DHB-Numerical packages

werner kassens-2
In reply to this post by SergeStinckwich
Hi Serge,
are there any simple routine things that i could help you with?
werner

On Sun, Mar 8, 2015 at 9:49 PM, Serge Stinckwich <[hidden email]> wrote:
Hi all,

I start to work on the fusion of Math-Random and Math-DHB-Numerical packages.
Some distributions are implemented in both packages.
The distributions in DHB do not follow the standard Random API like
next/peek and there is not tests ... Math-Random have tests, and
implement many RNG.

I already transfer one test from ExponentialGeneratorTest to
DHBExponentialDistributionTest.
More work need to be done ;-)

Regards,

--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.