Comments (2)
Hi @DavidJ005 ,
Usually the wide intervals are an expression of a local level component with a wide standard deviation. Local levels are essentially random walks which means the more they are fit to predict the data the less capable the covariates and the model as a whole were to explain it.
In order words, in order to decrease its interval range, best approach would be to find better covariates and better models that explain your observed data. This is heuristic based and you'll have to try several hypothesis to find what works best. Maybe adding seasonal components will help, maybe finding new covariates or new model components will reduce this interval.
Another thing you can try is setting the prior for the local level standard deviation equal to 0.01
. This only makes sense if you are confident that the covariates you used are a good fit and a local level component shouldn't be used much to explain observed data.
You can do so by instantiating the ci object with something like:
ci = CausalImpact(data, pre_period, post_period, model_args={'prior_level_sd': 0.01})
It may help you on this case, but it should only be done if you are confident that the covariates are good explanatory variables of the observed data.
Hope that helps,
Best,
Will
from tfcausalimpact.
Thanks for the help !
To give some feed back, I did try to lower the 'prior_level_sd', although I had to push it to 0,001.
The results are quite good, it tends to reduce the CI size to 6% (ie, >20% => <6%). In general it push the analyses in the edge of the middle area to the positive or negative while keeping some in the middle.
In my case I think it's pretty acceptable to set the hypothesis that the covariates are very explanatory. For example several shops in the same city are good covariates of each other in matter of sales under the hypothesis that they are not close enough to steal each other customers. Plus, in retail there is a lot of one-time events that can create local spikes (eg, a very sunny day, holidays, etc...) without having clear link with "Y", so ignoring these spikes is a very good thing to do since that they are difficult to replicate.
Anyway, it was very helpful.
Cheers !
David
from tfcausalimpact.
Related Issues (20)
- Fix for Dark Mode for plots? HOT 2
- comparison of output (impact$series$cum.effect) in Python and R packages HOT 2
- 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
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.