@@ -17,7 +17,9 @@ If any of these assumptions are violated, the causal estimate will be unreliable
1717
1818## Installation
1919
20- Requires Python 3.10+ and a Rust toolchain.
20+ Requires Python 3.10+.
21+ Binary wheels are intended for supported platforms, so Rust is only required
22+ when building from source.
2123
2224``` bash
2325pip install bsts-causalimpact
@@ -113,12 +115,12 @@ Tests run on every commit with seed-fixed MCMC for deterministic reproduction.
113115| Post-period Random Walk propagation | Matching | Forward simulation from last pre-period state |
114116| Data standardization (standardize.data=TRUE) | Matching | (y - mean) / sd using pre-period moments |
115117| prior.level.sd = 0.01 | Matching | Same default, same semantics |
116- | Spike-and-slab variable selection | Partial | Coordinate-wise sampling works; prior parameters ( expected.r2, prior.df) are approximate |
117- | expected.model.size | Partial | ` CausalImpact ` preserves the legacy default ` 2 ` ; ` ModelOptions ` keeps explicit default ` 1 ` |
118- | expected.r2 = 0.8, prior.df = 50 | Partial | Static regression prior is tuned for close R parity, not a byte-for-byte port |
118+ | Spike-and-slab variable selection | Matching | Coordinate-wise sampling with StudentSpikeSlabPrior defaults ( ` expected.r2=0.8 ` , ` prior.df=50 ` , ` prior.information.weight=0.01 ` , ` diagonal.shrinkage=0.5 ` ) |
119+ | expected.model.size | Matching | Unified default ` 2 ` in ` CausalImpact ` and ` ModelOptions ` |
120+ | expected.r2 = 0.8, prior.df = 50 | Matching | Same documented residual variance prior defaults as BoomSpikeSlab / bsts |
119121| Seasonal component (` nseasons ` , ` season_duration ` ) | Supported | R-compatible API with seasonal fixture coverage |
120122| Dynamic regression | Supported | Time-varying coefficients via random-walk FFBS; ` dynamic_regression=True ` |
121- | Local linear trend | Planned | R uses AddLocalLevel only by default; trend option exists but not ported |
123+ | Local linear trend | Supported | Opt in with ` state_model="local_linear_trend" ` |
122124
123125Covariate CI bounds are enforced twice: the legacy parity fixture remains tighter than
124126Phase 2 requirements, and a separate Phase 2 acceptance test keeps the threshold at ` ±3% ` .
@@ -145,10 +147,11 @@ Phase 2 requirements, and a separate Phase 2 acceptance test keeps the threshold
145147| ` seed ` | 0 | Random seed for reproducibility |
146148| ` prior_level_sd ` | 0.01 | Prior standard deviation for the local level |
147149| ` standardize_data ` | ` True ` | Standardize data before fitting |
148- | ` expected_model_size ` | 2 | Expected number of active covariates (spike-and-slab prior); ` ModelOptions ` keeps ` 1 ` |
150+ | ` expected_model_size ` | 2 | Expected number of active covariates (spike-and-slab prior) |
149151| ` nseasons ` | ` None ` | Optional seasonal cycle count (R-compatible API) |
150152| ` season_duration ` | ` None ` | Optional duration of each seasonal block; defaults to ` 1 ` when ` nseasons ` is set |
151153| ` dynamic_regression ` | ` False ` | Enable time-varying regression coefficients (random-walk beta) |
154+ | ` state_model ` | ` "local_level" ` | ` "local_level" ` or ` "local_linear_trend" ` |
152155
153156#### Methods and Properties
154157
@@ -157,7 +160,7 @@ Phase 2 requirements, and a separate Phase 2 acceptance test keeps the threshold
157160| ` summary(output="summary") ` | ` str ` | Tabular summary of causal effects |
158161| ` report() ` | ` str ` | Narrative interpretation of results |
159162| ` plot(metrics=None) ` | ` Figure ` | Matplotlib figure with original/pointwise/cumulative panels |
160- | ` inferences ` | ` DataFrame ` | Per-timestep effects , predictions, and credible intervals |
163+ | ` inferences ` | ` DataFrame ` | Per-timestep actuals , predictions, prediction s.d., and effect intervals |
161164| ` summary_stats ` | ` dict ` | Aggregate statistics (effect mean, CI, p-value, etc.) |
162165| ` posterior_inclusion_probs ` | ` ndarray \| None ` | Posterior inclusion probability per covariate |
163166
0 commit comments