Zephyr Scientific Library (zscilib)
Functions
probability.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <zsl/zsl.h>
#include <zsl/probability.h>

Go to the source code of this file.

Functions

zsl_real_t zsl_prob_uni_pdf (zsl_real_t *a, zsl_real_t *b, zsl_real_t *x)
 Computes the image of a value x of the uniform probability distribution function (PDF), which has zero probability everywhere except in the interval (a, b). More...
 
int zsl_prob_uni_mean (zsl_real_t *a, zsl_real_t *b, zsl_real_t *m)
 Computes the mean of a uniform probability distribution function of interval (a, b). More...
 
int zsl_prob_uni_var (zsl_real_t *a, zsl_real_t *b, zsl_real_t *v)
 Computes the variance of a uniform probability distribution function of interval (a, b). More...
 
zsl_real_t zsl_prob_uni_cdf (zsl_real_t *a, zsl_real_t *b, zsl_real_t *x)
 Computes the image of a value x of the uniform cumulative distribution function (CDF) with interval (a, b). More...
 
zsl_real_t zsl_prob_normal_pdf (zsl_real_t *m, zsl_real_t *s, zsl_real_t *x)
 Computes the image of a value x of the normal probability distribution function (PDF) of mean 'm' and standard deviation 's'. More...
 
zsl_real_t zsl_prob_normal_cdf (zsl_real_t *m, zsl_real_t *s, zsl_real_t *x)
 Computes the image of a value x of the normal cumulative distribution function (CDF) of mean 'm' and standard deviation 's'. More...
 
zsl_real_t zsl_prob_erf_inv (zsl_real_t *x)
 Computes the value of the inverse error fuction of a value 'x' using the Chebyshev interpolation to estimate the value of the function. More...
 
zsl_real_t zsl_prob_normal_cdf_inv (zsl_real_t *m, zsl_real_t *s, zsl_real_t *p)
 Computes the inverse of the normal cumulative distribution function of a value x. More...
 
int zsl_prob_factorial (int *n)
 Computes the factorial of a natural number, i. e., the finite product n * (n - 1) * (n - 2) * (n - 3) * ... * 3 * 2 * 1. More...
 
int zsl_prob_binomial_coef (int *n, int *k, int *c)
 Computes binomial coefficient of n and k (commonly writen as 'n over k'). More...
 
zsl_real_t zsl_prob_binomial_pdf (int *n, zsl_real_t *p, int *x)
 Computes the image of a value x of the binomial probability distribution function (PDF). More...
 
int zsl_prob_binomial_mean (int *n, zsl_real_t *p, zsl_real_t *m)
 Computes the mean of a binomial probability distribution function. More...
 
int zsl_prob_binomial_var (int *n, zsl_real_t *p, zsl_real_t *v)
 Computes the variance of a binomial probability distribution function. More...
 
zsl_real_t zsl_prob_binomial_cdf (int *n, zsl_real_t *p, int *x)
 Computes the image of a value x of the ubinomial cumulative distribution function (CDF). More...
 
int zsl_prob_entropy (struct zsl_vec *v, zsl_real_t *h)
 Computes the Shannon entropy of a set of events with given probabilities. More...
 
int zsl_prob_bayes (zsl_real_t *pa, zsl_real_t *pb, zsl_real_t *pba, zsl_real_t *pab)
 Computes the probability of an event A to occur given the event B, based on the probability of A, B and the probability of B given A, using the Bayes' Theorem. More...