StaggeredDifferenceInDifferences.fit#

StaggeredDifferenceInDifferences.fit(**kwargs)#

Run the posterior phase and populate result.

Builds the graph (idempotent), samples NUTS plus posterior predictive draws, then — when the backend supports a prior phase and no prior state exists yet — fills the prior groups and prior_result so idata is as complete as the historical eager fit produced. The posterior runs first to preserve the RNG stream of the historical eager baseline and keep integration comparisons meaningful. Each sampling phase re-arms the graph’s mutable data nodes before drawing, so design correctness does not depend on phase order. Standalone prior checks stay cheap: call sample_prior_predictive() directly before fit(). Re-running overwrites posterior state only and warns; prior state is preserved.

Returns:

The same experiment, for chaining. This turns every pre-1.0 call site into a one-token migration: cp.InterruptedTimeSeries(...).fit().

Return type:

Self

Parameters:

**kwargs (Any) – Forwarded to the posterior sampler (pymc.sample() for PyMC backends), overriding the model’s stored sample_kwargs for this call only.