Conformal Impact
Take Causal Impact and replace the Bayesian Structural Time Series Model with MFLES and the Basyesian posterior with Conformal Prediction Intervals.
Quick Examnple an comparison to Causal Impact
intervention_effect = 400
np.random.seed(42)
series = np.random.random((130, 1)) * 400
x_series = series * .4 + np.random.random((130, 1)) * 50 + 1000
trend = (np.arange(1, 131)).reshape((-1, 1))
series += 10 * trend
series[-30:] = series[-30:] + intervention_effect
data = pd.DataFrame(np.column_stack([series, x_series]), columns=['y', 'x1'])
import matplotlib.pyplot as plt
plt.plot(series)
plt.plot(x_series)
plt.show()
from ConformalImpact.Model import CI
conformal_impact = CI(opt_size=20,
opt_steps=10,
opt_step_size=3)
impact_df = conformal_impact.fit(data,
n_windows=30,
intervention_index=100,
seasonal_period=None)
conformal_impact.summary()
conformal_impact.plot()
from causalimpact import CausalImpact
impact = CausalImpact(data, [0, 99], [100, 130])
impact.run()
impact.plot()
print(impact.summary())
output = impact.inferences
np.mean(output['point_effect'].values[-30:])
Metadata
Release files for ConformalImpact 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ConformalImpact-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for ConformalImpact-0.0.3-py3-none-any.whl |
Release files / ConformalImpact-0.0.3-py3-none-any.whl
| Download URL | ConformalImpact-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21219c14df14602c8da2c19c33eeef79770be3d573173ac30bb323eb34705263
|
|
BLAKE2b-256 checksum How to use checksums |
9a059c1d22ab89817a45ce0b324945634944ae6b264b8c2774ecf3afb4c1a82c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.15
|
Security for ConformalImpact 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.