Random Walk Standard Deviation

class pypomp.RWSigma(sigmas: dict[str, float], init_names: Sequence[str] = (), cooling_fn: Callable | None = None)[source]

Bases: object

Random walk standard deviation configuration for IF2 parameter perturbation.

Stores per-parameter random walk standard deviations and a cooling schedule used by the Iterated Filtering 2 (IF2) algorithm. The cooling schedule reduces the perturbation magnitude over iterations so parameters converge to their maximum likelihood estimates.

Parameters:
  • sigmas (dict of str to float) – Mapping from parameter names to non-negative standard deviations for the perturbation random walk.

  • init_names (sequence of str, optional) – Subset of parameter names to treat as “initial” parameters (e.g. initial state parameters). These are perturbed with sigmas_init instead of sigmas in the algorithm. Defaults to an empty sequence.

  • cooling_fn (callable or None, optional) – Custom cooling function of signature (nt, m, ntimes) -> float. If None, defaults to a geometric schedule with a=0.5.

Examples

>>> rw = RWSigma({"beta": 0.02, "gamma": 0.01}).geometric_cooling(0.5)
>>> rw
RWSigma({'beta': 0.02, 'gamma': 0.01}, geometric a=0.5)

See also

Pomp.mif : Uses RWSigma to run IF2.

PanelPomp.mif : Uses RWSigma to run PIF/MPIF.

Attributes

RWSigma.sigmas: dict[str, float]

Dictionary mapping parameter names to sigma values.

RWSigma.init_names: tuple[str, ...]

Tuple of parameter names that are considered initial parameters.

RWSigma.not_init_names: tuple[str, ...]

Tuple of parameter names that are not considered initial parameters.

RWSigma.all_names: tuple[str, ...]

Tuple of all parameter names.

RWSigma.cooling_fn: Callable

A Callable taking (nt, m, ntimes) and returning a float cooling factor.

RWSigma.a: float | None

The geometric cooling parameter if configured.

RWSigma.s: float | None

The hyperbolic cooling parameter if configured.

RWSigma.c: float | None

The cosine cooling minimum factor if configured.

RWSigma.M: int | None

The cosine cooling duration if configured.

Methods

geometric_cooling(a)

Return a copy of this instance using geometric cooling.

cosine_cooling(c, M)

Return a copy of this instance using cosine annealing cooling.

hyperbolic_cooling(s)

Return a copy of this instance using hyperbolic cooling.

custom_cooling(cooling_fn)

Return a copy of this instance using a custom cooling function.

copy()

Return a copy of the RWSigma instance.

cooled(factor)

Scale all standard deviations by factor and return a new instance.

Dict-like Interface

Show inherited dictionary methods

keys()

Return a view of the parameter names.

values()

Return a view of the sigma values.

items()

Return a view of the parameter-sigma pairs.

get(param_name[, default])

Get the sigma value, or default if the parameter is not present.