Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/statistics/distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ module Distribution
end
end

# If Distribution is not defined, setup alias.
if defined?(Statistics) && !(defined?(Distribution))
Distribution = Statistics::Distribution
end
2 changes: 1 addition & 1 deletion lib/statistics/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Statistics
VERSION = "2.1.3"
VERSION = "3.0.0"
end
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
# D = 1, p-value = 6.657e-08
# alternative hypothesis: two-sided

men = Distribution::Normal.new(3.0, 1.0).random(elements: 10, seed: 100)
women = Distribution::Weibull.new(2.0, 3.0).random(elements: 20, seed: 100)
men = Statistics::Distribution::Normal.new(3.0, 1.0).random(elements: 10, seed: 100)
women = Statistics::Distribution::Weibull.new(2.0, 3.0).random(elements: 20, seed: 100)

# alpha, by default, is 0.05
result = described_class.two_samples(group_one: men, group_two: women)
Expand All @@ -55,8 +55,8 @@
# D = 0.4, p-value = 0.873
# alternative hypothesis: two-sided

men = Distribution::StandardNormal.new.random(elements: 500, seed: 10)
women = Distribution::StandardNormal.new.random(elements: 50, seed: 40)
men = Statistics::Distribution::StandardNormal.new.random(elements: 500, seed: 10)
women = Statistics::Distribution::StandardNormal.new.random(elements: 50, seed: 40)

# alpha, by default, is 0.05
result = described_class.two_samples(group_one: men, group_two: women)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# earthquakes compared by magnitude (TWO) and depth (THREE).
describe '#perform' do
it 'always computes the test approximating the U-statistic to the standard normal distribution' do
expect_any_instance_of(Distribution::StandardNormal)
expect_any_instance_of(Statistics::Distribution::StandardNormal)
.to receive(:cumulative_function).and_call_original

result = test_class.perform(0.05, :two_tail, [1,2,3], [4,5,6])
Expand Down