more_math 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1ad3e0cf20ab42f7e202c6caee8a612d672a3a68108dda8e3300cbdf35500b6
4
- data.tar.gz: 89b6c65af824597603e996573c0fd5eaf01aa115822d02027e4466aa9b730d10
3
+ metadata.gz: 0dea8884eed0b41c32c4d614efe6df1fc4144f688dd239a0b472175de3ee02e7
4
+ data.tar.gz: aa8251a1e275bce04d1ab85df84fd13b0ed726efd29818181493d8f27df71bf1
5
5
  SHA512:
6
- metadata.gz: a2cba2bed5b61d8ba4781677ea0ba361eabcd443c681833abe1400fa5bb5d1bb378ee86a056cdf4d70ef92c4861898a5a16784000903c107c2dca1c6a9704558
7
- data.tar.gz: 74a633595089428cc347224714a05f10de1f8e1bdc55ad7796b381a7c2c6101c1f49e3db2b23e1effc595344be3c2d1e4992f8c8ca065e5d9b419b71e6611265
6
+ metadata.gz: 1ba55a79ef2c6da6fc6019aa0431dd26592cae8c3792817f9de17a519395ba15ed897578a087a631effb52ce31355e94ff522157a93f254c963a49172438c54a
7
+ data.tar.gz: 37ebdb02b57fd9905cfd67d9e3713e970af944c5d3c35d345fd0b73d6229457fd2389a45bcc5cb4abf87bb5eda109b4d417ca6e3a11f45bf09c42252f59c79a4
@@ -333,6 +333,13 @@ module MoreMath
333
333
  end
334
334
  end
335
335
 
336
+ # Returns the interquartile range for this sequence.
337
+ def interquartile_range
338
+ quartile1 = percentile(25)
339
+ quartile3 = percentile(75)
340
+ quartile3 - quartile1
341
+ end
342
+
336
343
  # Return a result hash with the number of :very_low, :low, :high, and
337
344
  # :very_high outliers, determined by the box plotting algorithm run with
338
345
  # :median and :iqr parameters. If no outliers were found or the iqr is
@@ -1,6 +1,6 @@
1
1
  module MoreMath
2
2
  # MoreMath version
3
- VERSION = '1.0.2'
3
+ VERSION = '1.1.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/more_math.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: more_math 1.0.2 ruby lib
2
+ # stub: more_math 1.1.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "more_math".freeze
6
- s.version = "1.0.2".freeze
6
+ s.version = "1.1.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2024-07-03"
11
+ s.date = "2024-08-27"
12
12
  s.description = "Library that provides more mathematical functions/algorithms than standard Ruby.".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.extra_rdoc_files = ["README.md".freeze, "lib/more_math.rb".freeze, "lib/more_math/cantor_pairing_function.rb".freeze, "lib/more_math/constants/functions_constants.rb".freeze, "lib/more_math/continued_fraction.rb".freeze, "lib/more_math/distributions.rb".freeze, "lib/more_math/entropy.rb".freeze, "lib/more_math/exceptions.rb".freeze, "lib/more_math/functions.rb".freeze, "lib/more_math/histogram.rb".freeze, "lib/more_math/linear_regression.rb".freeze, "lib/more_math/newton_bisection.rb".freeze, "lib/more_math/numberify_string_function.rb".freeze, "lib/more_math/permutation.rb".freeze, "lib/more_math/ranking_common.rb".freeze, "lib/more_math/sequence.rb".freeze, "lib/more_math/sequence/moving_average.rb".freeze, "lib/more_math/sequence/refinement.rb".freeze, "lib/more_math/string_numeral.rb".freeze, "lib/more_math/subset.rb".freeze, "lib/more_math/version.rb".freeze]
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
17
17
  s.licenses = ["MIT".freeze]
18
18
  s.rdoc_options = ["--title".freeze, "MoreMath -- More Math in Ruby".freeze, "--main".freeze, "README.md".freeze]
19
19
  s.required_ruby_version = Gem::Requirement.new(">= 2.0".freeze)
20
- s.rubygems_version = "3.5.11".freeze
20
+ s.rubygems_version = "3.5.16".freeze
21
21
  s.summary = "Library that provides more mathematics.".freeze
22
22
  s.test_files = ["tests/cantor_pairing_function_test.rb".freeze, "tests/continued_fraction_test.rb".freeze, "tests/distribution_test.rb".freeze, "tests/entropy_test.rb".freeze, "tests/functions_test.rb".freeze, "tests/histogram_test.rb".freeze, "tests/newton_bisection_test.rb".freeze, "tests/numberify_string_function_test.rb".freeze, "tests/permutation_test.rb".freeze, "tests/sequence/refinement_test.rb".freeze, "tests/sequence_moving_average_test.rb".freeze, "tests/sequence_test.rb".freeze, "tests/string_numeral_test.rb".freeze, "tests/subset_test.rb".freeze, "tests/test_helper.rb".freeze]
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.15.0".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.17.0".freeze])
27
27
  s.add_development_dependency(%q<rake>.freeze, [">= 0".freeze])
28
28
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
29
29
  s.add_development_dependency(%q<test-unit>.freeze, [">= 0".freeze])
@@ -239,6 +239,7 @@ class SequenceTest < Test::Unit::TestCase
239
239
  assert_in_delta 48.0378, @rand_up.linear_regression.b, 1E-4
240
240
  assert_in_delta 0.98857, @rand_up.linear_regression.r2, 1E-4
241
241
  assert !@rand_up.linear_regression.slope_zero?
242
+ assert_in_delta 60.75, @rand.interquartile_range, 1E-4
242
243
  assert_nil @rand.detect_outliers
243
244
  assert !@rand.detect_autocorrelation[:detected]
244
245
  assert_equal [11, 14, 7, 9, 8, 7, 5, 11, 13, 15],
@@ -265,6 +266,7 @@ class SequenceTest < Test::Unit::TestCase
265
266
  assert_in_delta(23.94, @rasi.linear_regression.b, 1E-2)
266
267
  assert_in_delta 0.0887, @rasi.linear_regression.r2, 1E-4
267
268
  assert !@rasi.linear_regression.slope_zero?
269
+ assert_in_delta 51.3401, @rasi.interquartile_range, 1E-4
268
270
  assert_equal 13, @rasi.detect_outliers[:high]
269
271
  assert @rasi.detect_autocorrelation[:detected]
270
272
  assert_equal [4, 6, 11, 13, 22, 15, 12, 4, 7, 6],
@@ -292,6 +294,7 @@ class SequenceTest < Test::Unit::TestCase
292
294
  assert_in_delta(54.5420, @book.linear_regression.b, 1E-4)
293
295
  assert @book.linear_regression.slope_zero?
294
296
  assert_in_delta 0.0249, @book.linear_regression.r2, 1E-4
297
+ assert_in_delta 14.5, @book.interquartile_range, 1E-4
295
298
  assert_equal 7, @book.detect_outliers[:high]
296
299
  ought = [1.0, -0.39, 0.3, -0.17, 0.07, -0.10, 0.05, 0.04, -0.04, -0.01,
297
300
  0.01, 0.11, -0.07, 0.15, 0.04, -0.01
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: more_math
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.15.0
19
+ version: 1.17.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.15.0
26
+ version: 1.17.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.5.11
217
+ rubygems_version: 3.5.16
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Library that provides more mathematics.