stanbkt.fits.BaseFitOptions#

class stanbkt.fits.BaseFitOptions(seed=None, extra_kwargs=<factory>)#

Bases: object

Base dataclass for typed Stan fit options.

Parameters:
  • seed (int | None) – RNG seed for reproducibility.

  • extra_kwargs (dict[str, Any]) – Additional keyword arguments forwarded directly to CmdStanPy. These keys are merged last and therefore override generated defaults from dataclass fields.

Notes

Subclasses can add strongly typed fields and use extra_kwargs for less common or future CmdStanPy options.

extra_kwargs: dict[str, Any]#
classmethod from_dict(d)#

Create fit options from a dictionary.

Known dataclass fields are extracted and used for instantiation. Remaining keys are stored in extra_kwargs for CmdStanPy.

Parameters:

d (dict[str, Any]) – Dictionary containing fit options. Keys matching dataclass fields are assigned to those fields; remaining keys go to extra_kwargs.

Returns:

New instance of the fit options class with fields populated from dict.

Return type:

Self

seed: int | None = None#
to_dict()#

Convert options to a CmdStanPy kwargs dictionary.

None values are removed so CmdStanPy can apply its own defaults.

Returns:

Flat kwargs dictionary for CmdStanPy APIs.

Return type:

dict[str, Any]