Comments (2)
SAS is ungodly fast at the g-formula...
Using Keil et al. as a comparison (Nmc = 10000), SAS runs in 10.65 seconds. After some better code writing, It takes the v0.2.1 implementation (no Cython yet) 77.54 seconds!
The time difference is due to the MC loop. I think I have gotten near the limit of speed improvements due to better code writing alone. Cython is probably my next best best for closing the gap
from zepid.
After some additional changes, I have sped up TimeVaryGFormula up quite a bit compared to this first implementation. It is still slower than SAS. However, it seems to be any further improvements regarding speed would inhibit user-functionality (rewrite to only handle NumPy rather than pandas, wrap with cython after NumPy conversion). NumPy would probably lead to a similar time as SAS, but handling to arrays and dynamically recoding them becomes less straightforward for the user. Specifically errors on where a column is located become easier to mess up. Since the g-formula implementation is not the most straightforward, I think at this time it is better to take the hit on speed
Maybe at a future date I will try to implement only NumPy in the background but I am happy with the current speed. The big time crunch issue is the bootstrapped confidence intervals. My recommendation would be to use a cluster at this point (or rewrite my code but with NumPy for your implementation if speed is that big of an issue)
In case anyone views this thread in the future, rewriting TimeVaryGFormula to handle NumPy arrays would be my advice for quicker run time.
from zepid.
Related Issues (20)
- IPTW handle PerfectSeparationErrors in the marginal structural model better
- AIPW for survival analysis ? HOT 1
- Dual treatments
- ValueError better pytest strategy
- Package compatibility? HOT 2
- Update documentation (and possibly re-organize) HOT 2
- MonteCarloGFormula
- Add Odds Ratio and other estimands for AIPTW and TMLE
- Addition of meta-analysis tools
- add p-value column in a forrest plot/ effectmeasureplot HOT 2
- Enhancement in graphics.py to change odds text size HOT 1
- Saving DAGs programatically HOT 11
- sklearn dependancy in setup.py should be scikit-learn HOT 1
- AIPW formula equivalent to what's in the literature? HOT 2
- Perfect separation error for using `SingleCrossfitTMLE` HOT 2
- Superlearn check weights HOT 2
- SingleCrossFit `invalid value encountered in log` HOT 8
- Unable to install latest 0.9.0 version through pip HOT 7
- Risk Ratio Summary HOT 1
- The default regression argument of zepid.base.interaction_contrast_ratio differs from the description in the documentation. HOT 4
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 zepid.