pystra.distributions.zeroinflated.ZeroInflated#

class ZeroInflated(name, dist, p, input_type=None, startpoint=None)[source]#

Bases: Distribution

A Zero-Inflated rendering of the provided distribution.

Variable loads sometimes have values of zero when they are not occurring. This distribution creates a mixed distribution where there is a certain probability p of a zero value, otherwise with a probability 1-p a realization of the provided distribution occurs.

Attributes:
  • name (str): Name of the random variable

  • mean (float): Mean

  • stdv (float): Standard deviation

  • dist (Distribution): Distribution to zero-inflate

  • p (float): Probability of zero

  • input_type (any): Change meaning of mean and stdv

  • startpoint (float): Start point for seach

Methods

cdf

Cumulative distribution function

getMean

getName

getStartPoint

getStdv

jacobian

Compute the Jacobian (e.g.

pdf

Probability density function

plot

Plots the PDF of the distribution

ppf

inverse cumulative distribution function

sample

Return a sample of the distribution of length n

setStartPoint

set_location

Updating the zero-inflated distribution location parameter.

set_scale

Updating the zero-inflated distribution scale parameter.

set_zero_probability

Update the zero-inflated probability.

u_to_x

Transformation from u to x

x_to_u

Transformation from x to u

Attributes

std_normal

pdf(x)[source]#

Probability density function

cdf(x)[source]#

Cumulative distribution function

ppf(p)[source]#

inverse cumulative distribution function

u_to_x(u)[source]#

Transformation from u to x

x_to_u(x)[source]#

Transformation from x to u

jacobian(u, x)[source]#

Compute the Jacobian (e.g. Lemaire, eq. 4.9)

set_location(loc=0)[source]#

Updating the zero-inflated distribution location parameter.

set_scale(scale=1)[source]#

Updating the zero-inflated distribution scale parameter.

set_zero_probability(p)[source]#

Update the zero-inflated probability.

plot(ax=None, **kwargs)#

Plots the PDF of the distribution

sample(n=1000)#

Return a sample of the distribution of length n