public class PoissonDistribution extends Object implements ProbabilityMassFunction, LogProbabilityMassFunction, ConditionalDistribution<Double>, FirstOrderMoment<Double>, SecondOrderCentralMoment<Double>, SamplingDistribution<Integer>
Modifier and Type | Field and Description |
---|---|
protected double |
lambda
mean=variance of the distribution
|
protected Random |
rand |
Constructor and Description |
---|
PoissonDistribution(double lambda,
Random rand)
Constructor for Poisson distribution with parameter lambda (=mean=variance)
|
Modifier and Type | Method and Description |
---|---|
Integer |
drawSample()
Generate a new sample from this density.
|
Double |
getCondition()
Get conditional variable
|
Double |
getCovariance() |
Double |
getMean() |
double |
log_p(Integer k)
Evaluate natural logarithm of p(X) at location x. log(P(X=x))
|
double |
p(Integer k)
Evaluate p(X) at location x.
|
void |
setCondition(Double lambda)
Set the conditional variable
|
protected double lambda
protected Random rand
public PoissonDistribution(double lambda, Random rand)
lambda
- mean/variance of the distributionrand
- random generator for samplingpublic double p(Integer k)
EvaluatableDistribution
p
in interface EvaluatableDistribution<Integer>
k
- realization of random variable Xpublic double log_p(Integer k)
LogEvaluatableDistribution
log_p
in interface LogEvaluatableDistribution<Integer>
k
- realization of random variable Xpublic Double getCovariance()
getCovariance
in interface SecondOrderCentralMoment<Double>
public Double getMean()
getMean
in interface FirstOrderMoment<Double>
public Double getCondition()
ConditionalDistribution
getCondition
in interface ConditionalDistribution<Double>
public void setCondition(Double lambda)
ConditionalDistribution
setCondition
in interface ConditionalDistribution<Double>
lambda
- conditional variablepublic Integer drawSample()
SamplingDistribution
drawSample
in interface SamplingDistribution<Integer>
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.