Skip to content

ArgumentError: Paramters must be greater than zero. [sic] #655

@lrworth

Description

@lrworth

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:

  1. conversions == 1.
  2. We have some alternative where alternative.participant_count == 0.
  3. Under these conditions:
  • alpha = 1 + conversions so alpha == 1 + 1 == 2.
  • beta = 1 + alternative.participant_count - conversions so beta == 1 + 0 - 1 == 0
  1. In #calc_simulated_conversion_rates, beta is passed to RubyStats::BetaDistribution.
  2. BetaDistribution#initialize requires beta > 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 within dashboard/views/_experiment.erb if it will succeed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions