Comments (3)
Hi @IvanUkhov ,
Once again thanks for the information about the SparseLinearRegression, it does indeed model the weights in a very similar way as spike-and-slab from R does (this is in fact mentioned in the docstring of the class).
As a side note (for future reference also for those seeing this issue), the original R package does make some assumptions on its SpikeAndSlab implementation, mainly, they've considered that the prior.df
(first component of the gamma distribution for the standard deviation of the slab component) is 50, the expected R^2 is 0.8 and model size is set as 3. Internally, those values are manipulated accordingly to set the prior estimation for the sparsity of data and its variance.
For TFP, it uses instead a horseshoe distribution and only parameter we can manipulate is the weights_prior_scale which sets a prior for sparsity estimation as well (it's used when calculating the final values of the weights as a multiplicative term for local and global scales.)
Currently this value has been set as default (0.1). If someone finds a value that better models the assumptions from the original R package please feel free to either let us know or send a PR.
Still, probably final results wouldn't change much so it's more of a side feature nice to have :).
Let me know @IvanUkhov if the newer version of this package solves this issue for you.
Best,
Will
from tfcausalimpact.
Hi @IvanUkhov ,
Thanks for this reference :)! I'll research more about it and if the SparseLinearRegression
is closer to spike-and-slab I'll replace it soon.
When developing this package I compared several examples from the original R results with TFP using LinearRegression
and even though they differed a bit they tended to converge to similar values. After reading about the sparse version it does seem to be more appropriate (maybe it better models some sort of Lasso regression which affects the log-prob after all).
Thanks,
Will
from tfcausalimpact.
Thank you! I think it will be beneficial for the package in general. One of the selling points of the paper is that they take care of the variable selection via a prior inducing sparsity, which was not present here in any form until now.
from tfcausalimpact.
Related Issues (20)
- 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
- 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.