geossm.stmodel.Param

class geossm.stmodel.Param(name, value, fixed=False, bse=None)[source]

Bases: object

A single named model parameter, with its value, fixed/free status, and (once available) standard error.

Registered as a JAX pytree: when fixed is False, value is the single differentiable leaf (so Param instances can be passed directly through jax.grad); name, fixed and bse are static (non-differentiable) auxiliary data. A fixed parameter (or one with value=None) has no leaves at all, so it is excluded from gradient-based updates during fit().

Parameters:
  • name (str) – Parameter name (e.g. "beta", "s2e").

  • value (jax.numpy.ndarray or None) – Current parameter value. None before an initial value has been set.

  • fixed (bool, default False) – If True, the parameter is held at value and excluded from estimation in fit; if False, it is estimated.

  • bse (jax.numpy.ndarray or None, default None) – Standard error(s) of value, filled in by compute_cov_params(). None until then.

Methods

freeze

Return a copy of this parameter with fixed=True.

set

Return a copy of this parameter with value replaced.

tree_flatten

tree_unflatten

unfreeze

Return a copy of this parameter with fixed=False.

Attributes

bse

fixed

shape

Shape of value, or None if value is None.

size

Number of elements in value (0 if value is None).

name

value

name: str
value: Array | None
fixed: bool = False
bse: Array | None = None
set(new_value)[source]

Return a copy of this parameter with value replaced.

No-op (returns self unchanged) if the parameter is fixed.

Parameters:

new_value (array_like) – Replacement value.

Returns:

Param – A new Param with the updated value (or self, if fixed).

freeze()[source]

Return a copy of this parameter with fixed=True.

unfreeze()[source]

Return a copy of this parameter with fixed=False.

property shape

Shape of value, or None if value is None.

Type:

tuple or None

property size

Number of elements in value (0 if value is None).

Type:

int

tree_flatten()[source]
classmethod tree_unflatten(aux_data, children)[source]