-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentError: Paramters must be greater than zero. [sic] #655
Comments
I get a very similar problem with |
Probably related to #563. |
Hi there, yeah, it's probably related to that. BetaDistribution requires > 0. As the participation_count should not be less than the completed count. At first, the solution was to ensure the participation_count was also increased when someone forced that alternative. But then I reworked that on #637 in order to not take admin into metrics. So, it should not be possible to get into the same problem on v4. But that still leaves a problem where the counts on alternatives may already be wrong. I can make a patch to avoid running the BetaDistribution in such situations and think about how I can warn users about this on the dashboard. For now, you could |
Interesting. I’m not sure how I got my database into such a state but clearing Redis seems to have done the trick. If it’s always the case that participation_count >= completion_count then I’d personally prefer some kind of error describing which “impossible” thing happened so that I could fix it. But as you seem to have made this situation far less likely, it might not be worth the effort. Perhaps a guard and error log surrounding the call to BetaDistribution will suffice? If so I’m happy to provide a PR. |
Describe the bug
In
split-4.0.0.pre
, the dashboard page fails with an exception due to splitrb passing invalid parameters to BetaDistribution.To Reproduce
I haven't got a small reproduction case, but it is obvious what is happening. Within Split::Experiment#calc_beta_params:
conversions == 1
.alternative.participant_count == 0
.alpha = 1 + conversions
soalpha == 1 + 1 == 2
.beta = 1 + alternative.participant_count - conversions
sobeta == 1 + 0 - 1 == 0
#calc_simulated_conversion_rates
,beta
is passed toRubyStats::BetaDistribution
.BetaDistribution#initialize
requiresbeta > 0
and raises an exception.Assuming there is no bug in the logic here, a good resolution might be to only call
experiment.calc_winning_alternatives
withindashboard/views/_experiment.erb
if it will succeed.The text was updated successfully, but these errors were encountered: