|
| BernoulliDist (double p) |
| Creates a Bernoulli distribution object.
|
|
double | prob (int x) |
|
double | cdf (int x) |
|
double | barF (int x) |
|
int | inverseFInt (double u) |
|
double | getMean () |
| Returns the mean of the distribution function.
|
|
double | getVariance () |
| Returns the variance of the distribution function.
|
|
double | getStandardDeviation () |
| Returns the standard deviation of the distribution function.
|
|
double | getP () |
| Returns the parameter \(p\) of this object.
|
|
double [] | getParams () |
| Returns an array that contains the parameter \(p\) of the current distribution: [ \(p\)].
|
|
void | setParams (double p) |
| Resets the parameter to this new value.
|
|
String | toString () |
| Returns a String containing information about the current distribution.
|
|
abstract double | prob (int x) |
| Returns \(p(x)\), the probability of \(x\). More...
|
|
double | cdf (double x) |
| Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). More...
|
|
abstract double | cdf (int x) |
| Returns the distribution function \(F\) evaluated at \(x\) (see ( FDistDisc )). More...
|
|
double | barF (double x) |
| Returns \(\bar{F}(x)\), the complementary distribution function. More...
|
|
double | barF (int x) |
| Returns \(\bar{F}(x)\), the complementary distribution function. More...
|
|
int | getXinf () |
| Returns the lower limit \(x_a\) of the support of the probability mass function. More...
|
|
int | getXsup () |
| Returns the upper limit \(x_b\) of the support of the probability mass function. More...
|
|
double | inverseF (double u) |
| Returns the inverse distribution function \(F^{-1}(u)\), where. More...
|
|
int | inverseFInt (double u) |
| Returns the inverse distribution function \(F^{-1}(u)\), where. More...
|
|
|
static double | prob (double p, int x) |
| Returns the Bernoulli probability \(f(x)\) with parameter \(p\) (see eq. More...
|
|
static double | cdf (double p, int x) |
| Returns the Bernoulli distribution function \(F(x)\) with parameter \(p\) (see eq. More...
|
|
static double | barF (double p, int x) |
| Returns the complementary Bernoulli distribution function \(\bar{F}(x) = P[X \ge x]\) with parameter \(p\).
|
|
static int | inverseF (double p, double u) |
| Returns the inverse of the Bernoulli distribution function with parameter \(p\) at \(u\).
|
|
static double [] | getMLE (int[] x, int m) |
| Estimates the parameters \(p\) of the Bernoulli distribution using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1,…, m-1\). More...
|
|
static BernoulliDist | getInstanceFromMLE (int[] x, int m) |
| Creates a new instance of a Bernoulli distribution with parameter \(p\) estimated using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1, …, m-1\). More...
|
|
static double | getMean (double p) |
| Returns the mean \(E[X] = p\) of the Bernoulli distribution with parameter \(p\). More...
|
|
static double | getVariance (double p) |
| Computes the variance \(\mbox{Var}[X] = p(1 - p)\) of the Bernoulli distribution with parameter \(p\). More...
|
|
static double | getStandardDeviation (double p) |
| Computes the standard deviation of the Bernoulli distribution with parameter \(p\). More...
|
|
Extends the class DiscreteDistributionInt for the Bernoulli distribution [118] with parameter \(p\), where \(0\le p\le1\).
Its mass function is given by
\[ f(x) = \begin{cases} 1 - p, \qquad & \text{if $x = 0$;} \\ p, & \text{if $x = 1$;} \tag{fmass-bernoulli} \\ 0, & \text{otherwise.} \end{cases} \]
Its distribution function is
\[ F(x) = \begin{cases} 0, & \text{if $x < 0$;} \\ 1 - p, \qquad & \text{if $0 \le x < 1$;} \tag{cdf-bernoulli} \\ 1, & \text{if $x \ge1$.} \end{cases} \]
static double [] getMLE |
( |
int [] |
x, |
|
|
int |
m |
|
) |
| |
|
static |
Estimates the parameters \(p\) of the Bernoulli distribution using the maximum likelihood method, from the \(m\) observations \(x[i]\), \(i = 0, 1,…, m-1\).
The estimate is returned in a one-element array: [ \(p\)].
- Parameters
-
x | the list of observations used to evaluate parameters |
m | the number of observations used to evaluate parameters |
- Returns
- returns the parameter [ \(\hat{p}\)]