commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard <sebastien.bris...@m4x.org>
Subject Re: [math] Help understanding lower/upper/initialDomain in AbstractContinuousDistribution
Date Tue, 03 Jan 2012 06:11:22 GMT
Hi David,
2012/1/2 David Erickson <halcyon1981@gmail.com>:
> Hi all-
> I'm new to using the Math package but it looks great.  I need a couple
> distributions that aren't currently included, one as an example is the
> Generalized Extreme Value distribution
> (http://en.wikipedia.org/wiki/Generalized_extreme_value_distribution).
>  I've created a new class GeneralizedExtremeValueDistributionImpl that
> extends AbstractContinuousDistribution and implements
> cumulativeProbability:
>
>    @Override
>    public double cumulativeProbability(double x) throws MathException {
>        if (xi != 0) {
>            return -FastMath.pow(FastMath.E, FastMath.pow(1d+xi*((x -
> mu)/sigma), -1/xi));
>        } else {
>            return -FastMath.pow(FastMath.E, FastMath.pow(FastMath.E,
> -(x-mu)/sigma));
>        }
>    }
>
> According to the API I also need to implement getInitialDomain,
> getDomainLowerBound, getDomainUpperBound, I looked at the existing
> docs and other implementations but I'm still unclear on how these are
> used, and what I should be returning, particularly since the existing
> implementations primarily check if p is < or > .5 and return a
> (frequently) static value.  If anyone could help me shed some light on
> this I would be very appreciative.  Primarily I just need to use the
> distribution to generate RandomVariable values.
>
the methods you are referring to are used to provide an initial
bracket to the solver for the computation of the inverse cumulative
probability. It can be a very crude initial guess, provided that it
indeed brackets the root (the solver will do the rest): hence the
static values you are referring to.

Please note that these methods have recently been removed in the
latest version (3.0-SNAPSHOT). The implementation of new distributions
should now be much more straightforward. Are you adverse to using this
version?

Best regards,
Sébastien


>
> Thanks,
> David
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message