| Libgretl Reference Manual |
|---|
pvaluespvalues — |
double binomial_cdf (int k, int n, double p); double binomial_cdf_comp (int k, int n, double p); double x_factorial (double x); double log_x_factorial (double x); double normal_pvalue_2 (double x); double normal_pvalue_1 (double x); double t_cdf (double x, int df); double t_cdf_comp (double x, int df); double t_pvalue_2 (double x, int df); double t_critval (double a, int df); double chisq_cdf (double x, int df); double chisq_cdf_comp (double x, int df); double chisq_critval (double a, int df); double f_cdf (double x, int dfn, int dfd); double f_cdf_comp (double x, int dfn, int dfd); double f_critval (double a, int dfn, int dfd); double normal_cdf (double x); double normal_cdf_inverse (double x); double normal_pdf (double x); double normal_critval (double a); double log_normal_pdf (double x); double bvnorm_cdf (double a, double b, double rho); double gamma_cdf_comp (double s1, double s2, double x, int control); double tcrit95 (int df); double rhocrit95 (int n); double cephes_gamma (double x); double cephes_lgamma (double x); double gretl_get_pvalue (char st, const double *p); double gretl_get_cdf (char st, double *p); double gretl_get_critval (char st, double *p); int batch_pvalue (const char *str, double ***pZ, DATAINFO *pdinfo, PRN *prn); void print_pvalue (char st, double *p, double pv, PRN *prn);
double binomial_cdf (int k,
int n,
double p);
k : |
maximum number of successes. |
n : |
number of trials. |
p : |
probability of success on each trial. |
| Returns : | the probability of k or less successes on
n trials given binomial probability p, or
NADBL on failure.
|
double binomial_cdf_comp (int k,
int n,
double p);
k : |
maximum number of successes. |
n : |
number of trials. |
p : |
probability of success on each trial. |
| Returns : | the probability of k + 1 or more successes on
n trials given binomial probability p, or
NADBL on failure.
|
double x_factorial (double x);
x : |
input value. |
| Returns : | the factorial of int(x), cast to a double, or NADBL on failure. |
double log_x_factorial (double x);
x : |
input value. |
| Returns : | the log of the factorial of int(x), cast to a double, or NADBL on failure. |
double normal_pvalue_2 (double x);
Calculates the two-sided p-value for x in relation to the
standard normal distribution.
x : |
double-precision value. |
| Returns : | 2 times (1 minus the value of the standard normal
CDF evaluated at abs(x)).
|
double normal_pvalue_1 (double x);
Calculates the one-sided p-value for x in relation to the
standard normal distribution (that is, the probability that a
random variable distributed as N(0, 1) is greater than x).
x : |
double-precision value. |
| Returns : | 1 minus the value of the standard normal CDF
evaluated at x.
|
double t_cdf (double x,
int df);
x : |
the cutoff point in the distribution. |
df : |
degrees of freedom. |
| Returns : | the integral from minus infinity to x of
the t distribution with df degrees of freedom, or
NADBL on failure.
|
double t_cdf_comp (double x,
int df);
x : |
the cutoff point in the distribution. |
df : |
degrees of freedom. |
| Returns : | the integral from x to infinity of
the t distribution with df degrees of freedom, or
NADBL on failure.
|
double t_pvalue_2 (double x,
int df);
x : |
the cutoff point in the distribution. |
df : |
degrees of freedom. |
| Returns : | the probability that t(df) is greater than x
(two-sided, using the absolute value of x), or
NADBL on failure.
|
double t_critval (double a,
int df);
a : |
right-tail probability. |
df : |
degrees of freedom. |
| Returns : | the argument x such that the integral from x to
infinity of the t(df) density is equal to the given
probability a, or NADBL on failure.
|
double chisq_cdf (double x,
int df);
x : |
the cutoff point in the distribution. |
df : |
degrees of freedom. |
| Returns : | the integral from 0 to x of the chi-squared
distribution with df degrees of freedom, or NADBL
on failure.
|
double chisq_cdf_comp (double x,
int df);
x : |
the cutoff point in the distribution. |
df : |
degrees of freedom. |
| Returns : | the integral from x to infinity of the chi-squared
distribution with df degrees of freedom, or NADBL
on failure.
|
double chisq_critval (double a,
int df);
a : |
right-tail probability. |
df : |
degrees of freedom. |
| Returns : | the Chi-square argument x such that the integral
from x to infinity of the Chi-square density is equal
to the given probability a, or NADBL on failure.
|
double f_cdf (double x,
int dfn,
int dfd);
x : |
the cutoff point in the distribution. |
dfn : |
numerator degrees of freedom. |
dfd : |
denominator degrees of freedom. |
| Returns : | the integral of the F distribution with dfn and
dfd degrees of freedom, from 0 to x, or NADBL on failure.
|
double f_cdf_comp (double x,
int dfn,
int dfd);
x : |
the cutoff point in the distribution. |
dfn : |
numerator degrees of freedom. |
dfd : |
denominator degrees of freedom. |
| Returns : | the integral of the F distribution with dfn and
dfd degrees of freedom, from x to infinity, or NADBL
on failure.
|
double f_critval (double a,
int dfn,
int dfd);
a : |
right-tail probability. |
dfn : |
numerator degrees of freedom. |
dfd : |
denominator degrees of freedom. |
| Returns : | the F argument x such that the integral
from x to infinity of the F density is equal
to the given probability a, or NADBL on failure.
|
double normal_cdf (double x);
x : |
double-precision value. |
| Returns : | the value of the standard normal CDF evaluated
at x, or NADBL on failure.
|
double normal_cdf_inverse (double x);
x : |
double-precision value. |
| Returns : | the argument, y, for which the area under the Gaussian probability density function (integrated from minus infinity to y) is equal to x, or NADBL on failure. |
double normal_pdf (double x);
x : |
double-precision value. |
| Returns : | the value of the standard normal PDF evaluated
at x.
|
double normal_critval (double a);
a : |
right-tail probability. |
| Returns : | the argument z such that the integral from z to
infinity of the standard normal density is equal
to the given probability a, or NADBL on failure.
|
double log_normal_pdf (double x);
x : |
double-precision value. |
| Returns : | the value of the log-normal PDF evaluated
at x.
|
double bvnorm_cdf (double a,
double b,
double rho);
Ripped and adapted from Gnumeric, with a bug corrected for the case (a * b < 0) && (rho < 0).
a : |
input value. |
b : |
input value. |
rho : |
input value, correlation coefficient. |
| Returns : | for (x,y) a bivariate standard Normal rv with correlation coefficient rho, the joint probability that (x < a) && (y < b), or NADBL on failure. |
double gamma_cdf_comp (double s1,
double s2,
double x,
int control);
s1 : |
|
s2 : |
|
x : |
|
control : |
|
| Returns : |
double tcrit95 (int df);
df : |
degrees of freedom. |
| Returns : | the two-sided 95 percent critical value for the t
distribution with df degrees of freedom, or NADBL on
failure.
|
double rhocrit95 (int n);
n : |
sample size. |
| Returns : | the two-sided 95 percent critical value for the sample
correlation coefficient, sample size n, or NADBL on
failure.
|
int batch_pvalue (const char *str,
double ***pZ,
DATAINFO *pdinfo,
PRN *prn);
Calculates and prints the probability that a random variable
distributed as specified in the command line str exceeds the
value indicated in str.
str : |
the command line, which should be of one of the following forms: pvalue z x (Normal distribution); pvalue t df x (t-distribution); pvalue X df x (Chi-square); pvalue F dfn dfd x (F-distribution); or pvalue G mean variance x (Gamma distribution). pvalue B prob n x (Binomial distribution). pvalue P mean k (Poisson distribution). |
pZ : |
pointer to the data array. |
pdinfo : |
data information struct. |
prn : |
gretl printing struct. |
| Returns : | 0 on success, non-zero code on error. |
| << random | Utilities >> |