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

Andrew Waterman edited comment on MATH-460 at 9/26/12 1:18 PM:
---------------------------------------------------------------

Thanks for the help Phil! Do you think you could explain the following test? It 
seems like it should be overridden in my own test case, as I'm a bit confused 
about the set [250,250,250,250] for the variable "expected" below: 

Link: 
https://github.com/apache/commons-math/blob/trunk/src/test/java/org/apache/commons/math3/distribution/RealDistributionAbstractTest.java#L290

  public abstract class RealDistributionAbstractTest {

    ....

    /**
     * Test sampling
     */
    @Test
    public void testSampling() {
        final int sampleSize = 1000;
        distribution.reseedRandomGenerator(1000); // Use fixed seed
        double[] sample = distribution.sample(sampleSize);
        double[] quartiles = TestUtils.getDistributionQuartiles(distribution);
        double[] expected = {250, 250, 250, 250};
        long[] counts = new long[4];
        for (int i = 0; i < sampleSize; i++) {
            TestUtils.updateCounts(sample[i], counts, quartiles);
        }
        TestUtils.assertChiSquareAccept(expected, counts, 0.001);
    }
                
      was (Author: awaterma):
    Thanks for the help Phil! Do you think you could explain the following 
test? It seems like it should be overridden in my own test case, as I'm a bit 
confused about the set [250,250,250,250] for the variable "expected" below: 

  public abstract class RealDistributionAbstractTest {

    ....

    /**
     * Test sampling
     */
    @Test
    public void testSampling() {
        final int sampleSize = 1000;
        distribution.reseedRandomGenerator(1000); // Use fixed seed
        double[] sample = distribution.sample(sampleSize);
        double[] quartiles = TestUtils.getDistributionQuartiles(distribution);
        double[] expected = {250, 250, 250, 250};
        long[] counts = new long[4];
        for (int i = 0; i < sampleSize; i++) {
            TestUtils.updateCounts(sample[i], counts, quartiles);
        }
        TestUtils.assertChiSquareAccept(expected, counts, 0.001);
    }
                  
> Levy Distribution
> -----------------
>
>                 Key: MATH-460
>                 URL: https://issues.apache.org/jira/browse/MATH-460
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Pavel Ryzhov
>            Priority: Minor
>             Fix For: 3.2
>
>         Attachments: levy_math_460.patch
>
>
> Pretty straightforward implementation of Levy Distribution (not Levy 
> alpha-stable) according to http://en.wikipedia.org/wiki/Lévy_distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to