commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <>
Subject [math] Re: maximum number of iterations reached
Date Wed, 16 Mar 2011 04:02:39 GMT
On 3/15/11 1:36 AM, Thomas Anderson wrote:
> When using NormalDistributionImpl calss, I encounter the error throwing message
> org.apache.commons.math.ConvergenceException: maximum number of
> iterations reached
>         at org.apache.commons.math.special.Gamma.regularizedGammaP(
>         at org.apache.commons.math.special.Erf.erf(
>         at org.apache.commons.math.distribution.NormalDistributionImpl.cumulativeProbability(
>         at mypackage.Myclass.add(
>         at mypackage.Myclass.$
>         at java.util.concurrent.FutureTask$Sync.innerRun(
>         at
>         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
>         at java.util.concurrent.ScheduledThreadPoolExecutor$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> The value provided in cumulativeProbability is a double of current
> time subtracting previous timestamped e.g. t_now - t_prev
> What might cause this issue or how to fix it?

What version of Commons Math are you running?  From the line numbers
in the stack trace, it looks like you may be using 1.1, which is
ancient and had a bug that led to this error when cumulative
probabilities were evaluated for extreme values.  If possible, you
should upgrade to the latest version of Commons Math, which is
version 2.2.  If that is not possible, as a workaround, most likely
what is going on is you are asking for a cumulative probability that
is not distinguishable from either 0 or 1.  Check to make sure that
the actual parameter to the cumulative probability function is not
less than 40 standard deviations below the mean (in which case the
cum prob should be 0) or greater than 40 std devs above the mean (in
which case it should be 1).


> Thanks.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message