01: /*
02: * Copyright 2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.commons.math.distribution;
17:
18: import org.apache.commons.math.MathException;
19:
20: /**
21: * Interface representing the Poisson Distribution.
22: *
23: * <p>
24: * References:
25: * <ul>
26: * <li><a href="http://mathworld.wolfram.com/PoissonDistribution.html">
27: * Poisson distribution</a></li>
28: * </ul>
29: * </p>
30: *
31: * @version $Revision: 155427 $ $Date: 2005-02-26 06:11:52 -0700 (Sat, 26 Feb 2005) $
32: */
33: public interface PoissonDistribution extends IntegerDistribution {
34:
35: /**
36: * Get the mean for the distribution.
37: *
38: * @return the mean for the distribution.
39: */
40: public double getMean();
41:
42: /**
43: * Set the mean for the distribution.
44: * The parameter value must be positive; otherwise an
45: * <code>IllegalArgument</code> is thrown.
46: *
47: * @param p the mean
48: * @throws IllegalArgumentException if p ≤ 0
49: */
50: public void setMean(double p);
51:
52: /**
53: * Calculates the Poisson distribution function using a normal approximation.
54: *
55: * @param x the upper bound, inclusive
56: * @return the distribution function value calculated using a normal approximation
57: * @throws MathException if an error occurs computing the normal approximation
58: */
59: public double normalApproximateProbability(int x)
60: throws MathException;
61: }
|