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 +4 -4
- data/lib/more_math/sequence.rb +7 -0
- data/lib/more_math/version.rb +1 -1
- data/more_math.gemspec +5 -5
- data/tests/sequence_test.rb +3 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dea8884eed0b41c32c4d614efe6df1fc4144f688dd239a0b472175de3ee02e7
|
4
|
+
data.tar.gz: aa8251a1e275bce04d1ab85df84fd13b0ed726efd29818181493d8f27df71bf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba55a79ef2c6da6fc6019aa0431dd26592cae8c3792817f9de17a519395ba15ed897578a087a631effb52ce31355e94ff522157a93f254c963a49172438c54a
|
7
|
+
data.tar.gz: 37ebdb02b57fd9905cfd67d9e3713e970af944c5d3c35d345fd0b73d6229457fd2389a45bcc5cb4abf87bb5eda109b4d417ca6e3a11f45bf09c42252f59c79a4
|
data/lib/more_math/sequence.rb
CHANGED
@@ -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
|
data/lib/more_math/version.rb
CHANGED
data/more_math.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: more_math 1.0
|
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
|
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-
|
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.
|
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.
|
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])
|
data/tests/sequence_test.rb
CHANGED
@@ -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
|
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-
|
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.
|
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.
|
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.
|
217
|
+
rubygems_version: 3.5.16
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: Library that provides more mathematics.
|