commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Erickson <halcyon1...@gmail.com>
Subject [math] Help understanding lower/upper/initialDomain in AbstractContinuousDistribution
Date Mon, 02 Jan 2012 22:59:18 GMT
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.

Thanks,
David

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


Mime
View raw message