chronpy.psd.models#

build_namespace(names: list[str]) dict[str, list[str]][source]#

Build a namespace from a sequence of names.

Parameters:
namessequence of str

A sequence of names.

Returns:
namespace: dict

A dict of non-duplicate names and suffixes in original name order.

evaluate_stack(stack, result)[source]#
extract_stack(component, names)[source]#
class Model(component: Component)[source]#

Bases: Module

Attributes

default

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

power

power(params, freq_bins)[source]#
property prior#
property default#
class Component(*args: Any, **kwargs: Any)[source]#

Bases: Module

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

power(freq_bins)[source]#
abstract integral(freq_bins)[source]#
property params#
property prior#
class CompositeComponent(lhs: Component, rhs: Component, op: Callable)[source]#

Bases: Component

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

integral(freq_bins)[source]#
class NumIntComponent(*args: Any, **kwargs: Any)[source]#

Bases: Component

Base class for components that require numerical integration.

Parameters:
integratorstr, optional

The numerical integrator to use. Either ‘trapz’ or ‘simpson’.

nsubint, optional

The number of subintervals to use for numerical integration. The default is 1 for ‘trapz’ and 2 for ‘simpson’.

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

continuum

integral

power

integral(freq_bins: ndarray)[source]#
abstract continuum(freq)[source]#
class Const(*args: Any, **kwargs: Any)[source]#

Bases: Component

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

integral(freq_bins)[source]#
class PL(*args: Any, **kwargs: Any)[source]#

Bases: Component

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

integral(freq_bins)[source]#
class BrokenPL(*args: Any, **kwargs: Any)[source]#

Bases: Component

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

integral(freq_bins)[source]#
class BentPL(*args: Any, **kwargs: Any)[source]#

Bases: NumIntComponent

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

continuum

integral

power

continuum(freq)[source]#
class SmoothlyBrokenPL(*args: Any, **kwargs: Any)[source]#

Bases: NumIntComponent

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

continuum

integral

power

continuum(freq)[source]#
class Lorentz(*args: Any, **kwargs: Any)[source]#

Bases: Component

Attributes

params

prior

Methods

eval(**attributes)

Sets the Module to evaluation mode.

iter_children()

Iterates over all children Module's of the current Module.

iter_modules()

Recursively iterates over all nested Module's of the current Module, including the current Module.

perturb(name, value, variable_type)

Add an zero-value variable ("perturbation") to the intermediate value.

set_attributes(*filters[, raise_if_not_found])

Sets the attributes of nested Modules including the current Module.

sow(variable_type, name, value, reduce_fn, ...)

sow() can be used to collect intermediate values without the overhead of explicitly passing a container through each Module call.

train(**attributes)

Sets the Module to training mode.

integral

power

integral(freq_bins)[source]#