You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Pavel Ryzhov <pa...@gmail.com> on 2010/12/24 16:13:53 UTC

[math] Random Generator from Stable Distribution

Hi,

I've implemented a Stable random generator based on Chambers-Mallows-Stuck method as it is described in "Handbook of computational statistics: concepts and methods" by James E. Gentle, Wolfgang Härdle, Yuichi Mori

But I'm stuck on unit-testing of the generator as I don't have estimators of stable distribution parameters. I cannot use moments to approve/disapprove if the sample satisfies to the distribution

Thus I've to fall back to tests with known moments:
1. Normal distribution (alpha = 2 and beta=0.0)
2. Cauchy distribution (alpha = 1 and beta=0.0)
3. Alpha > 1
The alpha interval (0, 1) stays untested.

The questions are:
1. Is it worth to include it into Commons Math?
2. Are these unit-tests enough for acceptance?

Pavel
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Random Generator from Stable Distribution

Posted by Ted Dunning <te...@gmail.com>.
Can you use some other package to compute some quantiles for some particular
value of alpha?

On Fri, Dec 24, 2010 at 7:13 AM, Pavel Ryzhov <pa...@gmail.com>wrote:

> The alpha interval (0, 1) stays untested.
>

Re: [math] Random Generator from Stable Distribution

Posted by Pavel Ryzhov <pa...@gmail.com>.
So, I've created jira MATH-462 for it and attached the patch.
It doesn't contain tests for alpha in (0,1) yet. I'll take a look at R examples and will try to generate quantiles for some alpha.

On Dec 24, 2010, at 19:07 PM, Phil Steitz wrote:

> On Fri, Dec 24, 2010 at 10:13 AM, Pavel Ryzhov <pa...@gmail.com>wrote:
> 
>> Hi,
>> 
>> I've implemented a Stable random generator based on Chambers-Mallows-Stuck
>> method as it is described in "Handbook of computational statistics: concepts
>> and methods" by James E. Gentle, Wolfgang Härdle, Yuichi Mori
>> 
> 
> Thanks!  Looks good after quick review.
> 
>> 
>> But I'm stuck on unit-testing of the generator as I don't have estimators
>> of stable distribution parameters. I cannot use moments to
>> approve/disapprove if the sample satisfies to the distribution
>> 
>> Thus I've to fall back to tests with known moments:
>> 1. Normal distribution (alpha = 2 and beta=0.0)
>> 2. Cauchy distribution (alpha = 1 and beta=0.0)
>> 3. Alpha > 1
>> The alpha interval (0, 1) stays untested.
>> 
>> The questions are:
>> 1. Is it worth to include it into Commons Math?
>> 
> 
> Yes.
> 
> 
>> 2. Are these unit-tests enough for acceptance?
>> 
> 
> What I try to do in these cases is find another implementation to compare
> against of reference data somewhere.  I have not checked yet, but most
> likely R has this distribution.  The reference data for most of the other
> distribution comes from R.  Obviously, these tests are not definitive; but
> agreement with R is a good indication that the implementation is correct.
> Have a look in src/test/R.  See, for example, TDistributionTestCases.R.
> 
> Phil
> 
>> 
>> Pavel
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Random Generator from Stable Distribution

Posted by Phil Steitz <ph...@gmail.com>.
On Fri, Dec 24, 2010 at 10:13 AM, Pavel Ryzhov <pa...@gmail.com>wrote:

> Hi,
>
> I've implemented a Stable random generator based on Chambers-Mallows-Stuck
> method as it is described in "Handbook of computational statistics: concepts
> and methods" by James E. Gentle, Wolfgang Härdle, Yuichi Mori
>

Thanks!  Looks good after quick review.

>
> But I'm stuck on unit-testing of the generator as I don't have estimators
> of stable distribution parameters. I cannot use moments to
> approve/disapprove if the sample satisfies to the distribution
>
> Thus I've to fall back to tests with known moments:
> 1. Normal distribution (alpha = 2 and beta=0.0)
> 2. Cauchy distribution (alpha = 1 and beta=0.0)
> 3. Alpha > 1
> The alpha interval (0, 1) stays untested.
>
> The questions are:
> 1. Is it worth to include it into Commons Math?
>

Yes.


> 2. Are these unit-tests enough for acceptance?
>

What I try to do in these cases is find another implementation to compare
against of reference data somewhere.  I have not checked yet, but most
likely R has this distribution.  The reference data for most of the other
distribution comes from R.  Obviously, these tests are not definitive; but
agreement with R is a good indication that the implementation is correct.
Have a look in src/test/R.  See, for example, TDistributionTestCases.R.

Phil

>
> Pavel
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>