better / convoys

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

Nonparametric model (WIP) #26

Closed erikbern closed 6 years ago

erikbern commented 6 years ago

Adds a new model which is basically Kaplan-Meier but for conversion rates. Also fits it using Tensorflow using a MLE which is a bit different than Kaplan-Meier since I don't think the solution ends up being a closed form like KM because the LL is a bit more complex. The model converges very quickly in practice.

Ended up also fixing the predict API since it was a bit messed up... now it's all based on tensor algebra.

Fitting the same dataset (synthetic Weibull data):

Plotting using Weibull:

image

Plotting using Kaplan-Meier:

image

Plotting using the new nonparametric model:

image

More splines:

image

Not sure why some of the numbers are negative... I'll take a look at it

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-1.8%) to 86.089% when pulling 841c813cfca0e63b82b5880ab888691c12aa2f0f on nonparametric into 433d23c343a9a408c3f37824925898128d6ba1f5 on master.

erikbern commented 6 years ago

will investigate why the nonparametric model seems to exaggerate the early conversion rates