[ 
https://issues.apache.org/jira/browse/MATH-1536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17353069#comment-17353069
 ] 

Alex Herbert commented on MATH-1536:
------------------------------------

{quote}is a false claim?
{quote}
Yes. StableRandomGenerator is *not* Normalized by the definition of mean=0 
variance=1.
{quote}One cannot rely on the NormalizedRandomGenerator interface.
{quote}
No. But that is why the library should at least provide some implementations 
that are correct for other functionality that relies on it. It has 
GaussianRandomGenerator and UniformRandomGenerator.
{quote}They are probably among the older bug instances. :-}
{quote}
I looked at the git history to see where the computation originated. The class 
is functionally unchanged since its port from math to math3 over 9 years ago. I 
did not look prior to that as it involves a checkout of commons math 2, 
assuming the history is there.
{quote}What are uses-cases of this sampler?
{quote}
A distribution is said to be stable if a linear combination of two independent 
random variables with this distribution has the same distribution, up to 
location and scale parameters. The Gaussian distribution is a stable 
distribution, along with the Cauchy and Levy distributions.

>From the freely available chapter 1 of ['Univariate Stable Distributions: 
>Models for heavy tailed data' by John P. Nolan, Springer, 
>2020|https://www.springer.com/gp/book/9783030529147] (Nolan has published many 
>articles in the field and provides software for stable computations):
{noformat}
Stable distributions have been proposed as a model for many types of physical 
and economic
systems. There are several reasons for using a stable distribution to describe 
a system.
The first is where there are solid theoretical reasons for expecting a 
non-Gaussian stable
model, e.g. reflection off a rotating mirror yielding a Cauchy distribution, 
hitting times for
a Brownian motion yielding a Levy distribution, the gravitational field of 
stars yielding the ´
Holtsmark distribution; see Feller (1971) and Uchaikin and Zolotarev (1999) for 
these and
other examples.
{noformat}
The sampling uses the Chambers-Mallows-Stuck method and is well documented in 
Chambers, et al (1976) and proven in Weron, (1996) (see [Wikipedia: Simulation 
of stable 
variables|https://en.wikipedia.org/wiki/Stable_distribution#Simulation_of_stable_variables]).

A fixed version will be added to Commons RNG; it can be removed from CM.

 

> Sensitivity to RNG (unit tests)
> -------------------------------
>
>                 Key: MATH-1536
>                 URL: https://issues.apache.org/jira/browse/MATH-1536
>             Project: Commons Math
>          Issue Type: Task
>            Reporter: Gilles Sadowski
>            Priority: Major
>              Labels: rng, unit-test
>             Fix For: 4.0
>
>
> Several unit tests fail when upgrading to version 1.3 of "Commons RNG":
> {noformat}
> [ERROR] Failures: 
> [ERROR]   LogitTest.testDerivativesWithInverseFunction:195 maxOrder = 2 
> expected:<0.0> but was:<1.0658141036401503E-14>
> [ERROR]   EnumeratedIntegerDistributionTest.testMath1533:196
> [ERROR]   EnumeratedIntegerDistributionTest.testSample:174 expected:<7.84> 
> but was:<7.857073891264003>
> [ERROR]   MiniBatchKMeansClustererTest.testCompareToKMeans:86 Different score 
> ratio 46.645378%!, diff points ratio: 34.716981%
> [ERROR]   CalinskiHarabaszTest.test_compare_to_skLearn:102 
> expected:<597.7763150683217> but was:<559.2829020672648>
> [ERROR]   MultiStartMultivariateOptimizerTest.testCircleFitting:76 
> expected:<69.9597> but was:<69.96228624385736>
> [ERROR]   MultiStartMultivariateOptimizerTest.testRosenbrock:114 numEval=873
> [ERROR]   GaussianRandomGeneratorTest.testMeanAndStandardDeviation:37 
> expected:<1.0> but was:<0.9715310171501561>
> [ERROR]   NaturalRankingTest.testNaNsFixedTiesRandom:227 Array comparison 
> failure
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to