icecube_tools.source.power_law module
- class icecube_tools.source.power_law.BoundedPowerLaw(gamma, xmin, xmax)
Bases:
object
Definition of a bounded power law distribution.
pdf ~ x^(-alpha) betweem xmin and xmax.
Thanks to H. Niederhausen (@HansN87) for this implementation.
- cdf(x)
Evaluate the cumulative distribution function at x.
- inv_cdf(x)
Evaluate the inverse cumulative distribution function at x.
- pdf(x)
Evaluate the probability distribution function at x.
- samples(nsamples)
Inverse CDF sample from the bounded power law distribution.
- class icecube_tools.source.power_law.BoundedPowerLawExpCutoff(gamma, xcut, xmin, xmax)
Bases:
object
Definition of a bounded power law with an exponential cutoff.
- cdf(x)
Evaluates the cumulative distribution function (CDF) at x.
- inv_cdf(x)
Evaluates the inverse cumulative distribution function at x. Only defined for gamma < 1.
- pdf(x)
Evaluates the probability density function (PDF) at x.
- samples(nsamples)
Inverse transform sampling from the bounded power law distribution with exponential cutoff. Works only for gamma < 1.
- class icecube_tools.source.power_law.BoundedPowerLawSubexpCutoff(gamma, xcut, lambda_, xmin, xmax)
Bases:
object
Definition of a bounded power law with a subexponential cutoff.
- cdf(x)
Evaluated the cumulative distribution function at x.
- inv_cdf(x)
- pdf(x)
Evaluates the probability density function at x.
- samples(nsamples)
- class icecube_tools.source.power_law.BrokenBoundedPowerLaw(x0, x1, x2, gamma1, gamma2)
Bases:
object
Sampling from a broken power law.
Based on: https://github.com/grburgess/brokenpl_sample/blob/master/sample_broken_power_law.ipynb by J. M. Burgess (@grburgess).
- samples(N)
Sample from the broken power law.
- Parameters:
N – number of samples.