mvem.stats.gig

mvem.stats.gig.cdf

mvem.stats.gig.cdf(x, lmbda=1, chi=1, psi=1)[source]

Cumulative density function of the GIG distribution.

Parameters
  • x (np.ndarray) – An array of shape (n,) containing n observations of some univariate data.

  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

Returns

The cumulative density at each observation.

Return type

np.ndarray with shape (n,).

mvem.stats.gig.expect

mvem.stats.gig.expect(lmbda, chi, psi, func='x')[source]

Compute the expectation E[f(x)|lmbda, chi, psi], where f(x) is one of [“x”, “logx”, “1/x”].

Parameters
  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

  • func (str, optional) – The function to compute the expectation of. One of [“x”, “logx”, “1/x”]. Default to “x”.

Returns

The expected value

Return type

float

mvem.stats.gig.logcdf

mvem.stats.gig.logcdf(x, lmbda=1, chi=1, psi=1)[source]

Log-cumulative density function of the GIG distribution.

Parameters
  • x (np.ndarray) – An array of shape (n,) containing n observations of some univariate data.

  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

Returns

The log-cumulative density at each observation.

Return type

np.ndarray with shape (n,).

mvem.stats.gig.logpdf

mvem.stats.gig.logpdf(x, lmbda=1, chi=1, psi=1)[source]

Log-probability density function of the GIG distribution.

Parameters
  • x (np.ndarray) – An array of shape (n,) containing n observations of some univariate data.

  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

Returns

The log-density at each observation.

Return type

np.ndarray with shape (n,).

mvem.stats.gig.pdf

mvem.stats.gig.pdf(x, lmbda=1, chi=1, psi=1)[source]

Probability density function of the GIG distribution.

Parameters
  • x (np.ndarray) – An array of shape (n,) containing n observations of some univariate data.

  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

Returns

The density at each observation.

Return type

np.ndarray with shape (n,).

mvem.stats.gig.rvs

mvem.stats.gig.rvs(lmbda=1, chi=1, psi=1, size=1)[source]

Random number generator of the GIG distribution.

Parameters
  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

  • size (int, optional) – The number of samples to draw. Defaults to 1.

Returns

The random univariate numbers generated.

Return type

np.ndarray with shape (n,).

mvem.stats.gig.var

mvem.stats.gig.var(lmbda, chi, psi)[source]

Compute the variance of a GIG distribution with parameters (lmbda, chi, psi). When psi==0, the distribution is the inverse Gamma distribution, and when chi==0, the distribution is the Gamma distribution.

Handles a vector of parameters, if the different distributions all belong to the same group. That is, if chi==0 for one set of parameters, it must be so for all sets of parameters.

Parameters
  • lmbda (float) – Univariate parameter.

  • chi (float) – Univariate parameter.

  • psi (float) – Univariate parameter.

Returns

The variance

Return type

float