better / convoys

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

fix nonparametric model by reparametrizing #31

Closed erikbern closed 6 years ago

erikbern commented 6 years ago

This is a much better solution. Once we've found the MLE, reparametrize to avoid the cumsum thing. The only reason we can't do that during the optimization phase is that that would potentially involve negative probabilities, which would mess up the log-likelihood. But the MLE will actually be well formed so this works fine.

There's a wacky minor issue I still need to resolve which is that the second derivative of the last values of z ends up being enormous. Not sure why, will figure out what's causing it.

Weibull fit on Weibull data:

image

Nonparametric fit on the same data:

image

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.3%) to 86.445% when pulling 4c73e9d8c7de5c6ea6a5217aa6212ea3aa332e6f on nonparametric-reparametrize into 6206cbfed9570a3cb62d48052da035caa0388574 on master.

erikbern commented 6 years ago

Will investigate the z_std issue later.