User Documentation
 All Files Functions Groups
prob.sql_in File Reference

SQL functions for evaluating probability functions. More...

Go to the source code of this file.

Functions

float8 bernoulli_cdf (float8 x, float8 sp)
 Bernoulli cumulative distribution function. More...
 
float8 bernoulli_pmf (int4 x, float8 sp)
 Bernoulli probability mass function. More...
 
float8 bernoulli_quantile (float8 p, float8 sp)
 Bernoulli quantile function. More...
 
float8 beta_cdf (float8 x, float8 alpha, float8 beta)
 Beta cumulative distribution function. More...
 
float8 beta_pdf (float8 x, float8 alpha, float8 beta)
 Beta probability density function. More...
 
float8 beta_quantile (float8 p, float8 alpha, float8 beta)
 Beta quantile function. More...
 
float8 binomial_cdf (float8 x, int4 n, float8 sp)
 Binomial cumulative distribution function. More...
 
float8 binomial_pmf (int4 x, int4 n, float8 sp)
 Binomial probability mass function. More...
 
float8 binomial_quantile (float8 p, int4 n, float8 sp)
 Binomial quantile function. More...
 
float8 cauchy_cdf (float8 x, float8 location, float8 scale)
 Cauchy cumulative distribution function. More...
 
float8 cauchy_pdf (float8 x, float8 location, float8 scale)
 Cauchy probability density function. More...
 
float8 cauchy_quantile (float8 p, float8 location, float8 scale)
 Cauchy quantile function. More...
 
float8 chi_squared_cdf (float8 x, float8 df)
 Chi-squared cumulative distribution function. More...
 
float8 chi_squared_pdf (float8 x, float8 df)
 Chi-squared distribution probability density function. More...
 
float8 chi_squared_quantile (float8 p, float8 df)
 Chi-squared distribution quantile function. More...
 
float8 exponential_cdf (float8 x, float8 lambda)
 Exponential cumulative distribution function. More...
 
float8 exponential_pdf (float8 x, float8 lambda)
 Exponential probability density function. More...
 
float8 exponential_quantile (float8 p, float8 lambda)
 Exponential quantile function. More...
 
float8 extreme_value_cdf (float8 x, float8 location, float8 scale)
 Extreme Value cumulative distribution function. More...
 
float8 extreme_value_pdf (float8 x, float8 location, float8 scale)
 Extreme Value probability density function. More...
 
float8 extreme_value_quantile (float8 p, float8 location, float8 scale)
 Extreme Value quantile function. More...
 
float8 fisher_f_cdf (float8 x, float8 df1, float8 df2)
 Fisher F cumulative distribution function. More...
 
float8 fisher_f_pdf (float8 x, float8 df1, float8 df2)
 Fisher F probability density function. More...
 
float8 fisher_f_quantile (float8 p, float8 df1, float8 df2)
 Fisher F quantile function. More...
 
float8 gamma_cdf (float8 x, float8 shape, float8 scale)
 Gamma cumulative distribution function. More...
 
float8 gamma_pdf (float8 x, float8 shape, float8 scale)
 Gamma probability density function. More...
 
float8 gamma_quantile (float8 p, float8 shape, float8 scale)
 Gamma quantile function. More...
 
float8 geometric_cdf (float8 x, float8 sp)
 Geometric cumulative distribution function. More...
 
float8 geometric_pmf (int4 x, float8 sp)
 Geometric probability mass function. More...
 
float8 geometric_quantile (float8 p, float8 sp)
 Geometric quantile function. More...
 
float8 hypergeometric_cdf (float8 x, int4 r, int4 n, int4 N)
 Hypergeometric cumulative distribution function. More...
 
float8 hypergeometric_pmf (int4 x, int4 r, int4 n, int4 N)
 Hypergeometric probability mass function. More...
 
float8 hypergeometric_quantile (float8 p, int4 r, int4 n, int4 N)
 Hypergeometric quantile function. More...
 
float8 inverse_gamma_cdf (float8 x, float8 shape, float8 scale)
 Inverse Gamma cumulative distribution function. More...
 
float8 inverse_gamma_pdf (float8 x, float8 shape, float8 scale)
 Inverse Gamma probability density function. More...
 
float8 inverse_gamma_quantile (float8 p, float8 shape, float8 scale)
 Inverse Gamma quantile function. More...
 
float8 kolmogorov_cdf (float8 x)
 Kolmogorov cumulative distribution function. More...
 
float8 laplace_cdf (float8 x, float8 mean, float8 scale)
 Laplace cumulative distribution function. More...
 
float8 laplace_pdf (float8 x, float8 mean, float8 scale)
 Laplace probability density function. More...
 
float8 laplace_quantile (float8 p, float8 mean, float8 scale)
 Laplace quantile function. More...
 
float8 logistic_cdf (float8 x, float8 mean, float8 scale)
 Logistic cumulative distribution function. More...
 
float8 logistic_pdf (float8 x, float8 mean, float8 scale)
 Logistic probability density function. More...
 
float8 logistic_quantile (float8 p, float8 mean, float8 scale)
 Logistic quantile function. More...
 
float8 lognormal_cdf (float8 x, float8 location, float8 scale)
 Log-normal cumulative distribution function. More...
 
float8 lognormal_pdf (float8 x, float8 location, float8 scale)
 Log-normal probability density function. More...
 
float8 lognormal_quantile (float8 p, float8 location, float8 scale)
 Log-normal quantile function. More...
 
float8 negative_binomial_cdf (float8 x, float8 r, float8 sp)
 Negative binomial cumulative distribution function. More...
 
float8 negative_binomial_pmf (int4 x, float8 r, float8 sp)
 Negative binomial probability mass function. More...
 
float8 negative_binomial_quantile (float8 p, float8 r, float8 sp)
 Negative binomial quantile function. More...
 
float8 non_central_beta_cdf (float8 x, float8 alpha, float8 beta, float8 ncp)
 Noncentral beta cumulative distribution function. More...
 
float8 non_central_beta_pdf (float8 x, float8 alpha, float8 beta, float8 ncp)
 Noncentral beta probability density function. More...
 
float8 non_central_beta_quantile (float8 p, float8 alpha, float8 beta, float8 ncp)
 Noncentral beta quantile function. More...
 
float8 non_central_chi_squared_cdf (float8 x, float8 df, float8 ncp)
 Noncentral chi-squared cumulative distribution function. More...
 
float8 non_central_chi_squared_pdf (float8 x, float8 df, float8 ncp)
 Noncentral chi-squared distribution probability density function. More...
 
float8 non_central_chi_squared_quantile (float8 p, float8 df, float8 ncp)
 Noncentral chi-squared distribution quantile function. More...
 
float8 non_central_f_cdf (float8 x, float8 df1, float8 df2, float8 ncp)
 Noncentral Fisher F cumulative distribution function. More...
 
float8 non_central_f_pdf (float8 x, float8 df1, float8 df2, float8 ncp)
 Noncentral Fisher F probability density function. More...
 
float8 non_central_f_quantile (float8 p, float8 df1, float8 df2, float8 ncp)
 Noncentral Fisher F quantile function. More...
 
float8 non_central_t_cdf (float8 x, float8 df, float8 ncp)
 Noncentral Student-t cumulative distribution function. More...
 
float8 non_central_t_pdf (float8 x, float8 df, float8 ncp)
 Noncentral Student-t probability density function. More...
 
float8 non_central_t_quantile (float8 p, float8 df, float8 ncp)
 Noncentral Student-t quantile function. More...
 
float8 normal_cdf (float8 x, float8 mean=0, float8 sd=1)
 Normal cumulative distribution function. More...
 
float8 normal_pdf (float8 x, float8 mean=0, float8 sd=1)
 Normal probability density function. More...
 
float8 normal_quantile (float8 p, float8 mean=0, float8 sd=1)
 Normal quantile function. More...
 
float8 pareto_cdf (float8 x, float8 scale, float8 shape)
 Pareto cumulative distribution function. More...
 
float8 pareto_pdf (float8 x, float8 scale, float8 shape)
 Pareto probability density function. More...
 
float8 pareto_quantile (float8 p, float8 scale, float8 shape)
 Pareto quantile function. More...
 
float8 poisson_cdf (float8 x, float8 mean)
 Poisson cumulative distribution function. More...
 
float8 poisson_pmf (int4 x, float8 mean)
 Poisson probability mass function. More...
 
float8 poisson_quantile (float8 p, float8 mean)
 Poisson quantile function. More...
 
float8 rayleigh_cdf (float8 x, float8 scale)
 Rayleigh cumulative distribution function. More...
 
float8 rayleigh_pdf (float8 x, float8 scale)
 Rayleigh probability density function. More...
 
float8 rayleigh_quantile (float8 p, float8 scale)
 Rayleigh quantile function. More...
 
float8 students_t_cdf (float8 x, float8 df)
 Student's t cumulative distribution function. More...
 
float8 students_t_pdf (float8 x, float8 df)
 Student's t probability density function. More...
 
float8 students_t_quantile (float8 p, float8 df)
 Student's t quantile function. More...
 
float8 triangular_cdf (float8 x, float8 lower, float8 mode, float8 upper)
 Triangular cumulative distribution function. More...
 
float8 triangular_pdf (float8 x, float8 lower, float8 mode, float8 upper)
 Triangular probability density function. More...
 
float8 triangular_quantile (float8 p, float8 lower, float8 mode, float8 upper)
 Triangular quantile function. More...
 
float8 uniform_cdf (float8 x, float8 lower, float8 upper)
 Uniform cumulative distribution function. More...
 
float8 uniform_pdf (float8 x, float8 lower, float8 upper)
 Uniform probability density function. More...
 
float8 uniform_quantile (float8 p, float8 lower, float8 upper)
 Uniform quantile function. More...
 
float8 weibull_cdf (float8 x, float8 shape, float8 scale)
 Weibull cumulative distribution function. More...
 
float8 weibull_pdf (float8 x, float8 shape, float8 scale)
 Weibull probability density function. More...
 
float8 weibull_quantile (float8 p, float8 shape, float8 scale)
 Weibull quantile function. More...
 

Detailed Description

See Also
For an overview of probability functions, see the module description Probability Functions.

Definition in file prob.sql_in.

Function Documentation

float8 bernoulli_cdf ( float8  x,
float8  sp 
)
Parameters
xRandom variate \( x \)
spSuccess probability \( p \in [0,1] \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Bernoulli-distributed random variable with success probability \( \mathit{sp} \)

Definition at line 138 of file prob.sql_in.

float8 bernoulli_pmf ( int4  x,
float8  sp 
)
Parameters
xRandom variate \( x \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
\( f(x) \) where \( f \) is the probability mass function of a Bernoulli-distributed random variable with success probability \( \mathit{sp} \)

Definition at line 155 of file prob.sql_in.

float8 bernoulli_quantile ( float8  p,
float8  sp 
)
Parameters
pProbability \( p \in [0,1] \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
0 if \( p \leq 1 - \mathit{sp} \) and 1 otherwise

Definition at line 170 of file prob.sql_in.

float8 beta_cdf ( float8  x,
float8  alpha,
float8  beta 
)
Parameters
xRandom variate \( x \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a beta distributed random variable with shape parameters \( \alpha \) and \( \beta \)

Definition at line 188 of file prob.sql_in.

float8 beta_pdf ( float8  x,
float8  alpha,
float8  beta 
)
Parameters
xRandom variate \( x \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a beta random variable with shape parameters \( \alpha \) and \( \beta \)

Definition at line 207 of file prob.sql_in.

float8 beta_quantile ( float8  p,
float8  alpha,
float8  beta 
)
Parameters
pProbability \( p \in [0,1] \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is beta distribution random variable with shape parameters \( \alpha \) and \( \beta \)

Definition at line 226 of file prob.sql_in.

float8 binomial_cdf ( float8  x,
int4  n,
float8  sp 
)
Parameters
xRandom variate \( x \)
nThe number of trials \( n \in \mathbb N_0 \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a binomially distributed random variable with \( n \) trials and success probability \( \mathit{sp} \)

Definition at line 246 of file prob.sql_in.

float8 binomial_pmf ( int4  x,
int4  n,
float8  sp 
)
Parameters
xRandom variate \( x \)
nThe number of trials \( n \in \mathbb N_0 \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
\( f(x) \) where \( f \) is the probability mass function of a binomially distributed random variable with \( n \) trials and success probability \( \mathit{sp} \)

Definition at line 265 of file prob.sql_in.

float8 binomial_quantile ( float8  p,
int4  n,
float8  sp 
)
Parameters
pProbability \( p \in [0,1] \)
nThe number of trials \( n \in \mathbb N_0 \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
If \( p < 0.5 \) the maximum \( x \) such that \( p \geq \Pr[X \leq x] \). If \( p \geq 0.5 \) the minimum \( x \) such that \( p \leq \Pr[X \leq x] \). Here, \( X \) is a binomially distributed random variable with \( n \) trials and success probability \( \mathit{sp} \).

Definition at line 286 of file prob.sql_in.

float8 cauchy_cdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( x_0 \)
scaleScale \( \gamma > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Cauchy-distributed random variable with location and scale parameters \( x_0 \) and \( \gamma \), respectively

Definition at line 306 of file prob.sql_in.

float8 cauchy_pdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( x_0 \)
scaleScale \( \gamma > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Cauchy-distributed random variable with location and scale parameters \( x_0 \) and \( \gamma \), respectively

Definition at line 325 of file prob.sql_in.

float8 cauchy_quantile ( float8  p,
float8  location,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
locationLocation \( x_0 \)
scaleScale \( \gamma > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Cauchy-distributed random variable with location and scale parameters \( x_0 \) and \( \gamma \), respectively

Definition at line 344 of file prob.sql_in.

float8 chi_squared_cdf ( float8  x,
float8  df 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a chi-squared distributed random variable with \( \nu \) degrees of freedom

Definition at line 362 of file prob.sql_in.

float8 chi_squared_pdf ( float8  x,
float8  df 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a chi-squared distributed random variable with \( \nu \) degrees of freedom

Definition at line 379 of file prob.sql_in.

float8 chi_squared_quantile ( float8  p,
float8  df 
)
Parameters
pProbability \( p \in [0,1] \)
dfDegrees of freedom \( \mu > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a chi-squared distributed random variable with \( \nu \) degrees of freedom

Definition at line 396 of file prob.sql_in.

float8 exponential_cdf ( float8  x,
float8  lambda 
)
Parameters
xRandom variate \( x \)
lambdaRate parameter \( \lambda > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is an exponentially distributed random variable with rate parameter \( \lambda \)

Definition at line 413 of file prob.sql_in.

float8 exponential_pdf ( float8  x,
float8  lambda 
)
Parameters
xRandom variate \( x \)
lambdaRate parameter \( \lambda > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of exponentially distributed random variable with rate parameter \( \lambda \)

Definition at line 430 of file prob.sql_in.

float8 exponential_quantile ( float8  p,
float8  lambda 
)
Parameters
pProbability \( p \in [0,1] \)
lambdaRate parameter \( \lambda > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a exponentially distributed random variable with rate parameter \( \lambda \)

Definition at line 447 of file prob.sql_in.

float8 extreme_value_cdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( \alpha \)
scaleScale \( \beta > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is an extreme-value distributed random variable with location and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 466 of file prob.sql_in.

float8 extreme_value_pdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( \alpha \)
scaleScale \( \beta > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of an extreme-value distributed random variable with location and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 485 of file prob.sql_in.

float8 extreme_value_quantile ( float8  p,
float8  location,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
locationLocation \( \alpha \)
scaleScale \( \beta > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is an extreme-value distributed random variable with location and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 504 of file prob.sql_in.

float8 fisher_f_cdf ( float8  x,
float8  df1,
float8  df2 
)
Parameters
xRandom variate \( x \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Fisher F-distributed random variable with parameters \( \nu_1 \) and \( \nu_2 \)

Definition at line 523 of file prob.sql_in.

float8 fisher_f_pdf ( float8  x,
float8  df1,
float8  df2 
)
Parameters
xRandom variate \( x \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Fisher F-distributed random variable with parameters \( \nu_1 \) and \( \nu_2 \)

Definition at line 542 of file prob.sql_in.

float8 fisher_f_quantile ( float8  p,
float8  df1,
float8  df2 
)
Parameters
pProbability \( p \in [0,1] \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Fisher F-distributed random variable with parameters \( \nu_1 \) and \( \nu_2 \)

Definition at line 561 of file prob.sql_in.

float8 gamma_cdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( k > 0 \)
scaleScale \( \theta > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a gamma distributed random variable with shape and scale parameters \( k \) and \( \theta \), respectively

Definition at line 581 of file prob.sql_in.

float8 gamma_pdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( k > 0 \)
scaleScale \( \theta > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a gamma distributed random variable with shape and scale parameters \( k \) and \( \theta \), respectively

Definition at line 600 of file prob.sql_in.

float8 gamma_quantile ( float8  p,
float8  shape,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
shapeShape \( k > 0 \)
scaleScale \( \theta > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a gamma distributed random variable with shape and scale parameters \( k \) and \( \theta \), respectively

Definition at line 619 of file prob.sql_in.

float8 geometric_cdf ( float8  x,
float8  sp 
)
Parameters
xRandom variate \( x \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a geometrically distributed random variable with success probability \( \mathit{sp} \).

Definition at line 637 of file prob.sql_in.

float8 geometric_pmf ( int4  x,
float8  sp 
)
Parameters
xRandom variate \( x \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
\( f(x) \) where \( f \) is the probability mass function of a geometrically distributed random variable with success probability \( \mathit{sp} \)

Definition at line 654 of file prob.sql_in.

float8 geometric_quantile ( float8  p,
float8  sp 
)
Parameters
pProbability \( p \in [0,1] \)
spSuccess probability \( \mathit{sp} \in [0,1] \)
Returns
If \( p < 0.5 \) the maximum \( x \) such that \( p \geq \Pr[X \leq x] \). If \( p \geq 0.5 \) the minimum \( x \) such that \( p \leq \Pr[X \leq x] \). Here, \( X \) is a geometrically distributed random variable with success probability \( \mathit{sp} \).

Definition at line 673 of file prob.sql_in.

float8 hypergeometric_cdf ( float8  x,
int4  r,
int4  n,
int4  N 
)
Parameters
xRandom variate \( x \)
rNumber \( r \in \{ 0, 1, \dots, N \} \) of items with distinct property (sometimes called the number of success states in population)
nNumber \( n \in \{ 0, 1, \dots, N \} \) of draws (without replacement)
NTotal number \( N \in \mathbb N \) of items
Returns
\( \Pr[X \leq x] \) where \( X \) is a hypergeometrically distributed random variable with parameters \( r, n, N \)

Definition at line 698 of file prob.sql_in.

float8 hypergeometric_pmf ( int4  x,
int4  r,
int4  n,
int4  N 
)
Parameters
xRandom variate \( x \)
rNumber \( r \in \{ 0, 1, \dots, N \} \) of items with distinct property (sometimes called the number of success states in population)
nNumber \( n \in \{ 0, 1, \dots, N \} \) of draws (without replacement)
NTotal number \( N \in \mathbb N \) of items
Returns
\( f(x) \) where \( f \) is the probability mass function of a hypergeometrically distributed random variable with parameters \( r, n, N \)

Definition at line 722 of file prob.sql_in.

float8 hypergeometric_quantile ( float8  p,
int4  r,
int4  n,
int4  N 
)
Parameters
pProbability \( p \in [0,1] \)
rNumber \( r \in \{ 0, 1, \dots, N \} \) of items with distinct property (sometimes called the number of success states in population)
nNumber \( n \in \{ 0, 1, \dots, N \} \) of draws (without replacement)
NTotal number \( N \in \mathbb N \) of items
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a hypergeometrically distributed random variable with parameters \( r, n, N \)

Definition at line 747 of file prob.sql_in.

float8 inverse_gamma_cdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is an inverse-gamma distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 768 of file prob.sql_in.

float8 inverse_gamma_pdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of an inverse-gamma distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 787 of file prob.sql_in.

float8 inverse_gamma_quantile ( float8  p,
float8  shape,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is an inverse-gamma distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 806 of file prob.sql_in.

float8 kolmogorov_cdf ( float8  x)
Parameters
xRandom variate \( x \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Kolmogorov distributed random variable
See Also
Kolmogorov-Smirnov test: ks_test()

Definition at line 825 of file prob.sql_in.

float8 laplace_cdf ( float8  x,
float8  mean,
float8  scale 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
scaleScale \( b > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Laplace-distributed random variable with mean \( \mu \) and variance \( 2 b^2 \)

Definition at line 842 of file prob.sql_in.

float8 laplace_pdf ( float8  x,
float8  mean,
float8  scale 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
scaleScale \( b > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Laplace-distributed random variable with mean \( \mu \) and variance \( 2 b^2 \)

Definition at line 861 of file prob.sql_in.

float8 laplace_quantile ( float8  p,
float8  mean,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
meanMean \( \mu \)
scaleScale \( b > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Laplace-distributed random variable with mean \( \mu \) and variance \( 2 b^2 \)

Definition at line 880 of file prob.sql_in.

float8 logistic_cdf ( float8  x,
float8  mean,
float8  scale 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
scaleScale \( s > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a logistically distributed random variable with mean \( \mu \) and scale parameter \( s \)

Definition at line 899 of file prob.sql_in.

float8 logistic_pdf ( float8  x,
float8  mean,
float8  scale 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
scaleScale \( s > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a logistically distributed random variable with mean \( \mu \) and scale parameter \( s \)

Definition at line 918 of file prob.sql_in.

float8 logistic_quantile ( float8  p,
float8  mean,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
meanMean \( \mu \)
scaleScale \( s > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a logistically distributed random variable with mean \( \mu \) and scale parameter \( s \)

Definition at line 937 of file prob.sql_in.

float8 lognormal_cdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( m \)
scaleScale \( s > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a lognormally distributed random variable with location and scale parameters \( m \) and \( s \), respectively

Definition at line 957 of file prob.sql_in.

float8 lognormal_pdf ( float8  x,
float8  location,
float8  scale 
)
Parameters
xRandom variate \( x \)
locationLocation \( m \)
scaleScale \( s > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a lognormally distributed random variable with location and scale parameters \( m \) and \( s \), respectively

Definition at line 976 of file prob.sql_in.

float8 lognormal_quantile ( float8  p,
float8  location,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
locationLocation \( m \)
scaleScale \( s > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a lognormally distributed random variable with location and scale parameters \( m \) and \( s \), respectively

Definition at line 995 of file prob.sql_in.

float8 negative_binomial_cdf ( float8  x,
float8  r,
float8  sp 
)
Parameters
xRandom variate \( x \)
rTotal number \( r > 0 \) of successes in \( x + r \) trials (assuming success in the last trial)
spSuccess probability \( \mathit{sp} \in (0,1] \) in each trial
Returns
\( \Pr[X \leq x] \) where \( X \) is a negative-binomially distributed random variable with parameters \( r, \mathit{sp} \)

Definition at line 1015 of file prob.sql_in.

float8 negative_binomial_pmf ( int4  x,
float8  r,
float8  sp 
)
Parameters
xRandom variate \( x \)
rTotal number \( r > 0 \) of successes in \( x + r \) trials (assuming success in the last trial)
spSuccess probability \( \mathit{sp} \in (0,1] \) in each trial
Returns
\( f(x) \) where \( f \) is the probability mass function of a negative-binomially distributed random variable with parameters \( r, \mathit{sp} \)

Definition at line 1035 of file prob.sql_in.

float8 negative_binomial_quantile ( float8  p,
float8  r,
float8  sp 
)
Parameters
pProbability \( p \in [0,1] \)
rTotal number \( r > 0 \) of successes in \( x + r \) trials (assuming success in the last trial)
spSuccess probability \( \mathit{sp} \in (0,1] \) in each trial
Returns
If \( p < 0.5 \) the maximum \( x \) such that \( p \geq \Pr[X \leq x] \). If \( p \geq 0.5 \) the minimum \( x \) such that \( p \leq \Pr[X \leq x] \). Here, \( X \) is a negative-binomially distributed random variable with parameters \( r, \mathit{sp} \)

Definition at line 1057 of file prob.sql_in.

float8 non_central_beta_cdf ( float8  x,
float8  alpha,
float8  beta,
float8  ncp 
)
Parameters
xRandom variate \( x \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
ncpNoncentrality parameter \( \delta \geq 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a noncentral-beta distributed random variable with shape parameters \( shape_1 \) and \( shape_2 \) and noncentrality parameter \( \delta \)

Definition at line 1078 of file prob.sql_in.

float8 non_central_beta_pdf ( float8  x,
float8  alpha,
float8  beta,
float8  ncp 
)
Parameters
xRandom variate \( x \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
ncpNoncentrality parameter \( \delta \geq 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a noncentral-beta distributed random variable with shape parameters \( shape_1 \) and \( shape_2 \) and noncentrality parameter \( \delta \)

Definition at line 1100 of file prob.sql_in.

float8 non_central_beta_quantile ( float8  p,
float8  alpha,
float8  beta,
float8  ncp 
)
Parameters
pProbability \( p \in [0,1] \)
alphaShape \( \alpha > 0 \)
betaShape \( \beta > 0 \)
ncpNoncentrality parameter \( \delta \geq 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a noncentral-beta distributed random variable with shape parameters \( shape_1 \) and \( shape_2 \) and noncentrality parameter \( \delta \)

Definition at line 1122 of file prob.sql_in.

float8 non_central_chi_squared_cdf ( float8  x,
float8  df,
float8  ncp 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a noncentral-chi-squared distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \lambda \)

Definition at line 1143 of file prob.sql_in.

float8 non_central_chi_squared_pdf ( float8  x,
float8  df,
float8  ncp 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a noncentral-chi-squared distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \lambda \)

Definition at line 1162 of file prob.sql_in.

float8 non_central_chi_squared_quantile ( float8  p,
float8  df,
float8  ncp 
)
Parameters
pProbability \( p \in [0,1] \)
dfDegrees of freedom \( \nu > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a noncentral-chi-squared distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \lambda \)

Definition at line 1181 of file prob.sql_in.

float8 non_central_f_cdf ( float8  x,
float8  df1,
float8  df2,
float8  ncp 
)
Parameters
xRandom variate \( x \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a noncentral Fisher F-distributed random variable with parameters \( \nu_1, \nu_2, \lambda \)

Definition at line 1202 of file prob.sql_in.

float8 non_central_f_pdf ( float8  x,
float8  df1,
float8  df2,
float8  ncp 
)
Parameters
xRandom variate \( x \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a noncentral Fisher F-distributed random variable with parameters \( \nu_1, \nu_2, \lambda \)

Definition at line 1223 of file prob.sql_in.

float8 non_central_f_quantile ( float8  p,
float8  df1,
float8  df2,
float8  ncp 
)
Parameters
pProbability \( p \in [0,1] \)
df1Degrees of freedom in numerator \( \nu_1 > 0 \)
df2Degrees of freedom in denominator \( \nu_1 > 0 \)
ncpThe noncentrality parameter \( \lambda \geq 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a noncentral Fisher F-distributed random variable with parameters \( \nu_1, \nu_2, \lambda \)

Definition at line 1244 of file prob.sql_in.

float8 non_central_t_cdf ( float8  x,
float8  df,
float8  ncp 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
ncpNoncentrality parameter \( \delta \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a noncentral Student's t-distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \delta \)

Definition at line 1265 of file prob.sql_in.

float8 non_central_t_pdf ( float8  x,
float8  df,
float8  ncp 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
ncpNoncentrality parameter \( \delta \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a noncentral Student's t-distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \delta \)

Definition at line 1284 of file prob.sql_in.

float8 non_central_t_quantile ( float8  p,
float8  df,
float8  ncp 
)
Parameters
pProbability \( p \in [0,1] \)
dfDegrees of freedom \( \nu > 0 \)
ncpNoncentrality parameter \( \delta \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a noncentral Student's t-distributed random variable with \( \nu \) degrees of freedom and noncentrality parameter \( \delta \)

Definition at line 1303 of file prob.sql_in.

float8 normal_cdf ( float8  x,
float8  mean = 0,
float8  sd = 1 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
sdStandard deviation \( \sigma > 0 \)
Returns
\( \Pr[X \leq x] \) where \( T \) is a normally distributed random variable with mean \( \mu \) and variance \( \sigma^2 \)

Definition at line 1322 of file prob.sql_in.

float8 normal_pdf ( float8  x,
float8  mean = 0,
float8  sd = 1 
)
Parameters
xRandom variate \( x \)
meanMean \( \mu \)
sdStandard deviation \( \sigma > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a normally distributed random variable with mean \( \mu \) and variance \( \sigma^2 \)

Definition at line 1360 of file prob.sql_in.

float8 normal_quantile ( float8  p,
float8  mean = 0,
float8  sd = 1 
)
Parameters
pProbability \( p \in [0,1] \)
meanMean \( \mu \)
sdStandard deviation \( \sigma > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a normally distributed random variable with mean \( \mu \) and variance \( \sigma^2 \)

Definition at line 1398 of file prob.sql_in.

float8 pareto_cdf ( float8  x,
float8  scale,
float8  shape 
)
Parameters
xRandom variate \( x \)
scaleScale \( \beta > 0 \)
shapeShape \( \alpha > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Pareto-distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1437 of file prob.sql_in.

float8 pareto_pdf ( float8  x,
float8  scale,
float8  shape 
)
Parameters
xRandom variate \( x \)
scaleScale \( \beta > 0 \)
shapeShape \( \alpha > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Pareto-distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1456 of file prob.sql_in.

float8 pareto_quantile ( float8  p,
float8  scale,
float8  shape 
)
Parameters
pProbability \( p \in [0,1] \)
scaleScale \( \beta > 0 \)
shapeShape \( \alpha > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Pareto-distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1475 of file prob.sql_in.

float8 poisson_cdf ( float8  x,
float8  mean 
)
Parameters
xRandom variate \( x \)
meanAverage occurrence rate \( \lambda > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Poisson distributed random variable with mean \( \lambda \)

Definition at line 1493 of file prob.sql_in.

float8 poisson_pmf ( int4  x,
float8  mean 
)
Parameters
xRandom variate \( x \)
meanAverage occurrence rate \( \lambda > 0 \)
Returns
\( f(x) \) where \( f \) is the probability mass function of a Poisson distributed random variable with mean \( \lambda \)

Definition at line 1509 of file prob.sql_in.

float8 poisson_quantile ( float8  p,
float8  mean 
)
Parameters
pProbability \( p \in [0,1] \)
meanAverage occurrence rate \( \lambda > 0 \)
Returns
If \( p < 0.5 \) the maximum \( x \) such that \( p \geq \Pr[X \leq x] \). If \( p \geq 0.5 \) the minimum \( x \) such that \( p \leq \Pr[X \leq x] \). Here, \( X \) is a Poisson distributed random variable with mean \( \lambda \)

Definition at line 1527 of file prob.sql_in.

float8 rayleigh_cdf ( float8  x,
float8  scale 
)
Parameters
xRandom variate \( x \)
scaleScale \( \sigma > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Rayleigh-distributed random variable with parameter \( \sigma \)

Definition at line 1544 of file prob.sql_in.

float8 rayleigh_pdf ( float8  x,
float8  scale 
)
Parameters
xRandom variate \( x \)
scaleScale \( \sigma > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Rayleigh-distributed random variable with parameter \( \sigma \)

Definition at line 1560 of file prob.sql_in.

float8 rayleigh_quantile ( float8  p,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
scaleScale \( \sigma > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Rayleigh-distributed random variable with parameter \( \sigma \)

Definition at line 1576 of file prob.sql_in.

float8 students_t_cdf ( float8  x,
float8  df 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a Student's t-distributed random variable with \( \nu \) degrees of freedom

Definition at line 1593 of file prob.sql_in.

float8 students_t_pdf ( float8  x,
float8  df 
)
Parameters
xRandom variate \( x \)
dfDegrees of freedom \( \nu > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a Stundent's t-distributed random variable with \( \nu \) degrees of freedom

Definition at line 1610 of file prob.sql_in.

float8 students_t_quantile ( float8  p,
float8  df 
)
Parameters
pProbability \( p \in [0,1] \)
dfDegrees of freedom \( \nu > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a Student's t-distributed random variable with \( \nu \) degrees of freedom

Definition at line 1627 of file prob.sql_in.

float8 triangular_cdf ( float8  x,
float8  lower,
float8  mode,
float8  upper 
)
Parameters
xRandom variate \( x \)
lowerLower bound \( a \)
modeMode \( c \geq a \)
upperUpper bound \( b \geq c \), where \( b > a \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a triangular distributed random variable with parameters \( a, b, c \)

Definition at line 1646 of file prob.sql_in.

float8 triangular_pdf ( float8  x,
float8  lower,
float8  mode,
float8  upper 
)
Parameters
xRandom variate \( x \)
lowerLower bound \( a \)
modeMode \( c \geq a \)
upperUpper bound \( b \geq c \), where \( b > a \)
Returns
\( f(x) \) where \( f \) is the probability density function of a triangular distributed random variable with parameters \( a, b, c \)

Definition at line 1666 of file prob.sql_in.

float8 triangular_quantile ( float8  p,
float8  lower,
float8  mode,
float8  upper 
)
Parameters
pProbability \( p \in [0,1] \)
lowerLower bound \( a \)
modeMode \( c \geq a \)
upperUpper bound \( b \geq c \), where \( b > a \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a trianbular distributed random variable with parameters \( a, b, c \)

Definition at line 1686 of file prob.sql_in.

float8 uniform_cdf ( float8  x,
float8  lower,
float8  upper 
)
Parameters
xRandom variate \( x \)
lowerLower bound \( a \)
upperUpper bound \( b \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a uniform distributed random variable with support \( [a, b] \)

Definition at line 1706 of file prob.sql_in.

float8 uniform_pdf ( float8  x,
float8  lower,
float8  upper 
)
Parameters
xRandom variate \( x \)
lowerLower bound \( a \)
upperUpper bound \( b \)
Returns
\( f(x) \) where \( f \) is the probability density function of a uniform distributed random variable with support \( [a, b] \)

Definition at line 1724 of file prob.sql_in.

float8 uniform_quantile ( float8  p,
float8  lower,
float8  upper 
)
Parameters
pProbability \( p \in [0,1] \)
lowerLower bound \( a \)
upperUpper bound \( b \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a uniform distributed random variable with support \( [a, b] \)

Definition at line 1742 of file prob.sql_in.

float8 weibull_cdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( \Pr[X \leq x] \) where \( X \) is a weibull distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1762 of file prob.sql_in.

float8 weibull_pdf ( float8  x,
float8  shape,
float8  scale 
)
Parameters
xRandom variate \( x \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( f(x) \) where \( f \) is the probability density function of a weibull distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1781 of file prob.sql_in.

float8 weibull_quantile ( float8  p,
float8  shape,
float8  scale 
)
Parameters
pProbability \( p \in [0,1] \)
shapeShape \( \alpha > 0 \)
scaleScale \( \beta > 0 \)
Returns
\( x \) such that \( p = \Pr[X \leq x] \) where \( X \) is a weibull distributed random variable with shape and scale parameters \( \alpha \) and \( \beta \), respectively

Definition at line 1800 of file prob.sql_in.