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

Thomas Neidhart commented on MATH-1065:
---------------------------------------

Hi Matteo,

regarding the numerical issues:

the distribution works internally with an absolute accuracy of 1e-6. The 
results should be compared with an epsilon value like this.

There is currently no easy way to set another accuracy, but you can instantiate 
an EnumeratedRealDistribution like this, and override the 
getSolverAbsoluteAccuracy method:

{noformat}
        DISTRIBUTION = new EnumeratedRealDistribution(new double[]{
            14.0, 18.0, 21.0, 28.0, 31.0, 33.0
        }, new double[]{
            4.0 / 16.0, 5.0 / 16.0, 0.0 / 16.0, 3.0 / 16.0, 1.0 / 16.0, 3.0 / 
16.0
        }) {

            @Override
            protected double getSolverAbsoluteAccuracy() {
                return 1e-9;
            }
            
        };
{noformat}

> EnumeratedRealDistribution.inverseCumulativeProbability returns values not in 
> the samples set
> ---------------------------------------------------------------------------------------------
>
>                 Key: MATH-1065
>                 URL: https://issues.apache.org/jira/browse/MATH-1065
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>            Reporter: matteodg
>             Fix For: 4.0, 3.3
>
>         Attachments: EnumeratedRealDistributionTest.java
>
>
> The method EnumeratedRealDistribution.inverseCumulativeProbability() 
> sometimes returns values that are not in the initial samples domain...
> I will attach a test to exploit this bug.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to