Random Walk Standard Deviation¶
- class pypomp.RWSigma(sigmas: dict[str, float], init_names: Sequence[str] = (), cooling_fn: Callable | None = None)[source]¶
Bases:
objectRandom 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_initinstead ofsigmasin the algorithm. Defaults to an empty sequence.cooling_fn (callable or None, optional) – Custom cooling function of signature
(nt, m, ntimes) -> float. IfNone, defaults to a geometric schedule witha=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)
Attributes
- 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.cooling_fn: Callable¶
A Callable taking (nt, m, ntimes) and returning a float cooling factor.
Methods
Return a copy of this instance using geometric cooling. |
|
|
Return a copy of this instance using cosine annealing cooling. |
Return a copy of this instance using hyperbolic cooling. |
|
|
Return a copy of this instance using a custom cooling function. |
|
Return a copy of the RWSigma instance. |
|
Scale all standard deviations by |
Dict-like Interface