Skip to content
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

Update from Statistics{2,3} gem to fix C compilation #7

Merged
merged 1 commit into from
Apr 19, 2024
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ gem 'bundler'
gem 'rake'
gem 'rspec'
gem 'descriptive_statistics'
gem 'statistics2'
gem 'statistics3'
41 changes: 25 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
GEM
remote: http://rubygems.org/
specs:
awesome_print (1.9.2)
colorize (0.8.1)
descriptive_statistics (2.5.1)
diff-lcs (1.2.5)
rake (10.4.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.1)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (1.5.1)
psych (2.2.4)
rake (13.2.1)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
statistics2 (0.54)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
semver2 (3.4.2)
statistics3 (0.0.5)
awesome_print (~> 1)
colorize (~> 0)
psych (~> 2)
semver2 (~> 3)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
bundler
descriptive_statistics
rake
rspec
statistics2
statistics3

BUNDLED WITH
1.10.6
2.5.9
4 changes: 2 additions & 2 deletions lib/savanna-outliers/chauvenets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module Outliers
module Chauvenets
def chauvenets_criterion_min
delta = (mean - array.min).abs
(1/standard_deviation)*Statistics2.normaldist((delta - mean)/standard_deviation)*size
(1/standard_deviation)*Statistics3.normaldist((delta - mean)/standard_deviation)*size
end

def chauvenets_criterion_max
delta = (mean - array.max).abs
(1/standard_deviation)*Statistics2.normaldist((delta - mean)/standard_deviation)*size
(1/standard_deviation)*Statistics3.normaldist((delta - mean)/standard_deviation)*size
end

def outliers_chauvenets?
Expand Down
2 changes: 1 addition & 1 deletion lib/savanna-outliers/core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'descriptive_statistics/safe'
require 'statistics2'
require 'statistics3'
require 'savanna-outliers/general_parameters'
require 'savanna-outliers/grubbs'
require 'savanna-outliers/chauvenets'
Expand Down
4 changes: 2 additions & 2 deletions lib/savanna-outliers/grubbs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def grubbs_test_statistic_minimum

def grubbs_two_sided_test(n = size, alpha = 0.05)
a = (n - 1)/Math.sqrt(n)
t = Statistics2.ptdist(n-2,alpha/(2*n))**2
t = Statistics3.ptdist(n-2,alpha/(2*n))**2
b = Math.sqrt( t/(n-2+t) )
a*b
end

def grubbs_one_sided_test(n = size, alpha = 0.05)
a = (n - 1)/Math.sqrt(n)
t = Statistics2.ptdist(n-2,alpha/n)**2
t = Statistics3.ptdist(n-2,alpha/n)**2
b = Math.sqrt( t/(n-2+t) )
a*b
end
Expand Down
4 changes: 2 additions & 2 deletions lib/savanna-outliers/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Savanna
module Outliers
VERSION = '0.0.1'
VERSION = '0.0.2'
end
end
end
2 changes: 1 addition & 1 deletion savanna-outliers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_dependency 'descriptive_statistics'
gem.add_dependency 'statistics2'
gem.add_dependency 'statistics3'
end