better / convoys

Implementation of statistical models to analyze time lagged conversions
https://better.engineering/convoys/
MIT License
254 stars 42 forks source link

weibull regression (MAP and bayesian version) #6

Closed erikbern closed 6 years ago

erikbern commented 6 years ago

Implemented a regression model using pymc3, so fully Bayesian.

The good news is that it was very easy to implement (once I discovered the pymc3.Potential class). The bad news is this is slow as hell. It barely works for more than a few thousand datapoints – whereas the current models happily fit 100k datapoints in a few seconds.

I'm tempted to revert to my original idea of just fitting this using MAP and then computing the Hessian of the MAP to get a normal approximation of the posterior distribution. Seems a bit janky but I think it will be a pretty good approximation in practice, and probably ~100x faster.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-2.6%) to 69.296% when pulling eb25d1914af52e0c3e9a269424c4d7c399e8dddf on weibull-regression into 62c0e24e44829133375e6a54d9b89c6157f2b792 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-2.6%) to 69.296% when pulling eb25d1914af52e0c3e9a269424c4d7c399e8dddf on weibull-regression into 62c0e24e44829133375e6a54d9b89c6157f2b792 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-2.6%) to 69.296% when pulling eb25d1914af52e0c3e9a269424c4d7c399e8dddf on weibull-regression into 62c0e24e44829133375e6a54d9b89c6157f2b792 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-3.8%) to 68.031% when pulling 05bcbf32c005c0c46a0ed6cd2be44a7513bf0025 on weibull-regression into 62c0e24e44829133375e6a54d9b89c6157f2b792 on master.

erikbern commented 6 years ago

will repurpose this to a straightforward MAP using scipy.optimize

erikbern commented 6 years ago

merging this for now since it doesn't interfere with any of the existing code

kind of annoying to have three different versions of the same tool though, i might unify it later