popsynth.aux_samplers package

Submodules

popsynth.aux_samplers.delta_aux_sampler module

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

Bases: AuxiliarySampler

xp
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]

popsynth.aux_samplers.lognormal_aux_sampler module

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

Bases: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.lognormal_aux_sampler.Log10NormalAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]

popsynth.aux_samplers.normal_aux_sampler module

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

Bases: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]

popsynth.aux_samplers.plaw_aux_sampler module

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

Bases: AuxiliarySampler

xmin
alpha
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.plaw_aux_sampler.PowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

xmin
xmax
alpha
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.plaw_aux_sampler.BrokenPowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

xmin
alpha
xbreak
beta
xmax
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]

popsynth.aux_samplers.sky_sampler module

class popsynth.aux_samplers.sky_sampler.SkySampler(ra_sampler: Optional[NonObservedAuxSampler] = None, dec_sampler: Optional[NonObservedAuxSampler] = None)[source]

Bases: object

__init__(ra_sampler: Optional[NonObservedAuxSampler] = None, dec_sampler: Optional[NonObservedAuxSampler] = None)[source]

A sky sampler that samples angular positions in ra and dec. If no samplers are provided, then loads default samplers that sample uniformly on the unit sphere. RA and dec are in radians.

Parameters
  • ra_sampler (NonObservedAuxSampler) – Right ascension (RA) sampler

  • dec_sampler (NonObservedAuxSampler) – Declination (Dec) sampler

property ra_sampler
property dec_sampler
class popsynth.aux_samplers.sky_sampler.RASampler[source]

Bases: NonObservedAuxSampler

__init__()[source]

Samples the right ascension (RA) uniformly on the unit sphere.

RA is in radians.

true_sampler(size)[source]
class popsynth.aux_samplers.sky_sampler.DecSampler[source]

Bases: NonObservedAuxSampler

__init__()[source]

Samples the declination (Dec) uniformly on the unit sphere.

Dec is in radians.

true_sampler(size)[source]

popsynth.aux_samplers.trunc_normal_aux_sampler module

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

Bases: AuxiliarySampler

mu
tau
lower
upper
sigma
__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

true_sampler(size)[source]
observation_sampler(size)[source]

popsynth.aux_samplers.viewing_angle_sampler module

class popsynth.aux_samplers.viewing_angle_sampler.ViewingAngleSampler[source]

Bases: NonObservedAuxSampler

max_angle
__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

true_sampler(size: int) None[source]

Sample the viewing angle by inverse CDF

Parameters

size (int) – Number of samples

Module contents

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

Bases: AuxiliarySampler

xp
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.ViewingAngleSampler[source]

Bases: NonObservedAuxSampler

max_angle
__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

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: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.Log10NormalAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.NormalAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

mu
tau
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.TruncatedNormalAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

mu
tau
lower
upper
sigma
__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

true_sampler(size)[source]
observation_sampler(size)[source]
class popsynth.aux_samplers.ParetoAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

xmin
alpha
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.PowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

xmin
xmax
alpha
sigma
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]
class popsynth.aux_samplers.BrokenPowerLawAuxSampler(name: str, observed: bool = True)[source]

Bases: AuxiliarySampler

xmin
alpha
xbreak
beta
xmax
__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

true_sampler(size: int)[source]
observation_sampler(size: int)[source]