Boost logo

Boost :

From: Andrew Sutton (asutton_at_[hidden])
Date: 2007-12-14 12:04:43


> So you can call it whatever you like and still be right :-)
>
> BTW I believe the min and max cases are basically just mirror
> images of each
> other about the location parameter?

So names aside, it's all the extreme value distribution, but there
are minimum and maximum variations of it.

After doing more math than I've done in some time, I'll agree to
that :) Actually, the min/max case are so similar that it might be
worth considering generalizing the extreme value distribution to
handle both cases. It comes down to adding a third parameter, c which
is either 1 or -1. Naturally, 1 for max, -1 for min.

c(x) = (c * (a - x)) / b
pdf(x) = exp(c(x) - exp(cx))

if c == 1, then it's the maximum case. If c == -1, then it's the
minimum because (a - x) becomes (x - a). Unfortunately, the cdf's are
a little different...

cdf(x) = {
exp(-exp(c(x)), for c == 1
1 - exp(-exp(c(x)), for c== -1
}

Which is kind of fun because the cdf for the minimum is the
complement of the cdf for the maximum (and vice versa for respective
complements). The characteristics (outside the mean) are all the
same. The mean can be redefined given as:

mean = a + c * b * euler

I don't know what the effect on the quantile functions would be,
since I'm not sure how to compute those.

I spent the last hour rewriting the extreme_value_distribution to
accept a sign argument, allowing it to act as either the min or max
case of the distribution. It defaults to the max. I also figured out
how to tweak the random number generator to generate numbers for both
cases (also taking the additional parameter). The code is here and here:

http://warhol.sdml.cs.kent.edu/trac/miniboost/browser/trunk/boost/
math/distributions/extreme_value.hpp
http://warhol.sdml.cs.kent.edu/trac/miniboost/browser/trunk/boost/
random/extreme_value_distribution.hpp

Thoughts?

Andrew Sutton
asutton_at_[hidden]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk