Comments (2)
Hi @rj678 ,
The preperiod
as given by your assignment would be computed in Python by something like:
preperiod = ci.inferences['post_cum_effects_means'][ci.inferences['post_cum_effects_means'].isna()]
Which essentially retrieves completed predictions of training data. In R package the empty values were assigned as "zeroes" whereas in Python, as they don't exist, remained as NaN
.
Notice also that if you want to work with pre_period
data it's also available in the ci
object in ci.pre_data
or ci.normed_pre_data
(the latter is same data but with normalization applied).
As for varying results, did the results you observed differ too much from the official README report? I just ran it here and had very close results — using hmc
method. They will never be the same as the algorithm behind is not deterministic but they should always converge to the same conclusions and be very close for the most part.
Results are expected to change from the original R package as well but again they should lead to same conclusions and be similar overall. The cumulative field will differ more as it sums up all estimated points in post period.
Let me know if this helps you,
Best,
Will
from tfcausalimpact.
thanks so much for confirming that the empty values are zero in in R, and NaN in Python - from what I remember, the difference between the non-zero values in impact$series$cum.effect
and ci.inferences['post_cum_effects_means']
was not insignificant - I'll check again and get back, thanks so much for the detailed response.
from tfcausalimpact.
Related Issues (20)
- Problems with the tensorflow_probability HOT 7
- Type-error HOT 7
- Installation HOT 3
- Add compatibility for Python 3.10 HOT 4
- 'CausalImpact' object has no attribute 'posterior_dist' HOT 2
- TypeError: ufunc 'isfinite' not supported for the input types HOT 5
- is there a way to check the coefficient of regression part ? HOT 4
- Saving Figures of the Model Output HOT 2
- AttributeError: 'NoneType' object has no attribute 'loc' HOT 4
- Understanding the results and improving the model HOT 2
- p-value is always less than 0.5 HOT 1
- How to save model ? HOT 2
- Categorical Variables HOT 2
- have an error when using customized model HOT 6
- ResourceExhaustedError HOT 1
- How to save the results HOT 2
- Support Python 3.11
- AttributeError: 'NoneType' object has no attribute 'loc' HOT 3
- how to specify which column is y HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfcausalimpact.