[Home] Restricted access for guests. The link to Java source code is disabled
Java source code of 'jhplot.fit.Poisson'
package jhplot.fit;
import hep.aida.ref.function.AbstractIFunction;
import jhplot.math.num.pdf.*;
import java.lang.Math;
/**
* Poisson distribution.
*/
public class Poisson extends AbstractIFunction {
public Poisson() {
this("Poisson");
}
public Poisson(String title) {
super(title, 1, 2);
}
public Poisson(String[] variableNames, String[] parameterNames) {
super(variableNames, parameterNames);
}
public double value(double[] v) {
jhplot.math.num.pdf.Poisson nbd2= new jhplot.math.num.pdf.Poisson( p[1]);
// return p[0] * Probability.negativeBinomial((int)v[0], (int)p[1], p[2]);
return p[0] * nbd2.probability( (int)v[0] );
}
// Here change the parameter names
protected void init(String title) {
parameterNames[0] = "norm";
parameterNames[1] = "lambda";
super.init(title);
}
}