poplar.distributions

Some standard distributions with vectorised probability density functions (pdfs) and a routine for numerical cumulative density function (CDF) computation and distribution sampling.

If the user requires other distributions, they can implement them as their own class by subclassing the Distribution base class and adding their own methods as required.

Classes

FixedLimitsPowerLaw

A power law distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

VariableLimitsPowerLaw

A power law distribution with variable limits (i.e. the pdf takes the limits as arguments).

FixedLimitsTruncatedGaussian

A truncated normal distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

UniformDistribution

A uniform distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

FixedLimitBetaDistribution

A Beta distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

FixedLimitTruncatedBetaDistribution

A Truncated Beta distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

FixedLimits_PowerLawTruncatedGaussian

A distribution similar to Peak+PowerLaw with fixed bounds (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Module Contents

class poplar.distributions.FixedLimitsPowerLaw(limits, npoints=1000, grid_spacing='logarithmic', device='cpu')

Bases: Distribution

A power law distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.VariableLimitsPowerLaw(limits, npoints=1000, grid_spacing='logarithmic', device='cpu')

Bases: Distribution

A power law distribution with variable limits (i.e. the pdf takes the limits as arguments).

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.FixedLimitsTruncatedGaussian(limits, npoints=1000, grid_spacing='linear', device='cpu')

Bases: Distribution

A truncated normal distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Ref : http://parker.ad.siu.edu/Olive/ch4.pdf

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.UniformDistribution(limits, npoints=1000, grid_spacing='linear', device='cpu')

Bases: Distribution

A uniform distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.FixedLimitBetaDistribution(limits, npoints=1000, grid_spacing='linear', device='cpu')

Bases: Distribution

A Beta distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.FixedLimitTruncatedBetaDistribution(limits, npoints=1000, grid_spacing='linear', device='cpu')

Bases: Distribution

A Truncated Beta distribution with fixed limits (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation).

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”

class poplar.distributions.FixedLimits_PowerLawTruncatedGaussian(limits, npoints=1000, grid_spacing='linear', device='cpu')

Bases: Distribution

A distribution similar to Peak+PowerLaw with fixed bounds (i.e. the pdf does not take the limits as arguments, they are fixed at initialisation). Ref : https://arxiv.org/abs/2010.14533

Parameters:
limitslist

[Lower, Upper] limits for this distribution. Used to initialise the CDF computational grid.

npointsint, optional

number of points in CDF computational grid, by default 1000

grid_spacingstr, optional

specifies either linear or logarithmic spacing for CDF computational grid, by default ‘linear’

devicestr, optional

pytorch device this distribution operates using, by default “cpu”