popsynth.aux_samplers package

Module contents

class popsynth.aux_samplers.DeltaAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A delta-function sampler for which the true value is fixed at xp. Assumes property is observed by default, in which case the observed value is sampled from the true value with some normally-distributed error, sigma.

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • xp (AuxiliaryParameter) – Value at which delta function is located
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
observation_sampler(size: int)[source]
sigma
true_sampler(size: int)[source]
xp
class popsynth.aux_samplers.ViewingAngleSampler[source]

Bases: popsynth.auxiliary_sampler.NonObservedAuxSampler

__init__()[source]

A viewing angle sampler that samples from 0 to max_angle. Unlike other samplers, it assumes that this is NOT an observed property

Parameters:max_angle (AuxiliaryParameter) – The maximum angle to which to sample in degrees
max_angle
true_sampler(size: int) → None[source]

Sample the viewing angle by inverse CDF

Parameters:size (int) – Number of samples
class popsynth.aux_samplers.LogNormalAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A Log normal sampler, where property ~ e^N(mu, sigma).

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • mu (AuxiliaryParameter) – Mean of the lognormal
  • tau (AuxiliaryParameter) – Standard deviation of the lognormal
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
mu
observation_sampler(size: int)[source]
sigma
tau
true_sampler(size: int)[source]
class popsynth.aux_samplers.Log10NormalAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A Log10 normal sampler, where property ~ 10^N(mu, sigma).

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • mu (AuxiliaryParameter) – Mean of the log10normal
  • tau (AuxiliaryParameter) – Standard deviation of the log10normal
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
mu
observation_sampler(size: int)[source]
sigma
tau
true_sampler(size: int)[source]
class popsynth.aux_samplers.NormalAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A normal distribution sampler, where property ~ N(mu, sigma).

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • mu (AuxiliaryParameter) – Mean of the normal
  • tau (AuxiliaryParameter) – Standard deviation of the normal
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
mu
observation_sampler(size: int)[source]
sigma
tau
true_sampler(size: int)[source]
class popsynth.aux_samplers.TruncatedNormalAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A truncated normal sampler, where property ~ N(mu, sigma), between lower and upper.

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • mu (AuxiliaryParameter) – Mean of the normal
  • tau (AuxiliaryParameter) – Standard deviation of the normal
  • lower (AuxiliaryParameter) – Lower bound of the truncation
  • upper (AuxiliaryParameter) – Upper bound of the truncation
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
lower
mu
observation_sampler(size)[source]
sigma
tau
true_sampler(size)[source]
upper
class popsynth.aux_samplers.ParetoAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A pareto distribution sampler, where property ~ 1 / x^(alpha + 1).

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • xmin (AuxiliaryParameter) – Minimum value of the pareto
  • alpha (AuxiliaryParameter) – Index of the pareto
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
alpha
observation_sampler(size: int)[source]
sigma
true_sampler(size: int)[source]
xmin
class popsynth.aux_samplers.PowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A bounded power law distribution sampler, where property ~ x^``alpha``.

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • xmin (AuxiliaryParameter) – Minimum value of the power law
  • xmax (:class:``AuxiliaryParameter) – Maximum value of the power law
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
alpha
observation_sampler(size: int)[source]
sigma
true_sampler(size: int)[source]
xmax
xmin
class popsynth.aux_samplers.BrokenPowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: popsynth.auxiliary_sampler.AuxiliarySampler

__init__(name: str, observed: bool = True)[source]

A broken power law distribution sampler, where property ~ x^``alpha`` for x < xbreak, and property ~ x^``beta`` for x > xbreak.

Parameters:
  • name (str) – Name of the property
  • observed (bool) – True if the property is observed, False if it is latent. Defaults to True
  • xmin (AuxiliaryParameter) – Minimum value of the broken power law
  • xmax (:class:``AuxiliaryParameter) – Maximum value of the broken power law
  • sigma (AuxiliaryParameter) – Standard deviation of normal distribution from which observed values are sampled, if observed is True
alpha
beta
observation_sampler(size: int)[source]
true_sampler(size: int)[source]
xbreak
xmax
xmin