25package umontreal.ssj.probdist;
27import java.util.Formatter;
28import java.util.Locale;
29import umontreal.ssj.util.*;
30import umontreal.ssj.functions.MathFunction;
73 return density(m_n, m_k, m_h, x);
76 public double cdf(
double x) {
77 return cdf(m_n, m_k, m_h, x);
80 public double barF(
double x) {
81 return barF(m_n, m_k, m_h, x);
98 public static double density(
int n,
int k,
double h,
double x) {
101 double r = -Math.expm1(-h * x);
103 return h * v * Math.exp(-h * x);
116 public static double cdf(
int n,
int k,
double h,
double x) {
119 double r = -Math.expm1(-h * x);
135 public static double barF(
int n,
int k,
double h,
double x) {
138 double r = Math.exp(-h * x);
153 public static double inverseF(
int n,
int k,
double h,
double u) {
154 if (u < 0.0 || u > 1.0)
155 throw new IllegalArgumentException(
"u not in [0,1]");
157 return Double.POSITIVE_INFINITY;
162 return -Math.log1p(-z) / h;
172 double[] par =
new double[] { m_n, m_k, m_h };
176 public void setParams(
int n,
int k,
double h) {
180 m_lambda =
new double[k];
181 for (
int i = 0; i < k; i++) {
182 m_lambda[i] = (n - i) * h;
187 StringBuilder sb =
new StringBuilder();
188 Formatter formatter =
new Formatter(sb, Locale.US);
190 formatter.format(
" %d, %d, %f", m_n, m_k, m_h);
191 formatter.format(
"}%n");
192 return sb.toString();
Extends the class ContinuousDistribution for the beta distribution.
double inverseF(double u)
Returns the inverse distribution function .
double cdf(double x)
Returns the distribution function .
double density(double x)
Returns , the density evaluated at .
String toString()
Returns a String containing information about the current distribution.
HypoExponentialDistEqual(int n, int k, double h)
Constructor for equidistant rates.
double[] getParams()
Returns the three parameters of this hypoexponential distribution as array .
static double density(int n, int k, double h, double x)
Computes the density function , with the same arguments as in the constructor.
double barF(double x)
Returns the complementary distribution function.
static double cdf(int n, int k, double h, double x)
Computes the distribution function , with arguments as in the constructor.
static double barF(int n, int k, double h, double x)
Computes the complementary distribution , as in formula ( conv-hypo-equal ).
double cdf(double x)
Returns the distribution function .
static double inverseF(int n, int k, double h, double u)
Computes the inverse distribution , with arguments as in the constructor.
double density(double x)
Returns , the density evaluated at .
double inverseF(double u)
Returns the inverse distribution function .
HypoExponentialDist(double[] lambda)
Constructs a HypoExponentialDist object, with rates lambda[ ], .