lite-statistics 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/docs/descriptive/{ZSCORE.md → ZSCORES.md} +5 -5
- data/lib/lite/statistics/descriptive.rb +9 -10
- data/lib/lite/statistics/enumerable.rb +1 -1
- data/lib/lite/statistics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e04bb561d9e72db744d7c0bdcc367266dd1b6c1255ec6690aadc932a8030e946
|
4
|
+
data.tar.gz: 03110c348899191d55ab411d716edd90fe62c99e829e4a3db899168c93efbad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd5917de35a1a857bbb2ef7730b715b48d74b8157e02b7b84fe1973e6203cbb86c9f634c4cf9bba5bfa7fef7c01c4a12cff2e0f926d25ec080116e56c4ba594
|
7
|
+
data.tar.gz: 754c6035decae068e801374dadcab618d4c51aa780f073ee6e8b347b8ad20a41deb5cb323c5fbee409caaa9045d23bab909280aa2fd3e6fb024762ef09e50e21
|
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [1.0.2] - 2019-07-18
|
10
|
+
### Changed
|
11
|
+
- Rename zscores to zscoress
|
12
|
+
|
9
13
|
## [1.0.1] - 2019-07-18
|
10
14
|
### Changed
|
11
15
|
- Memoization to use Lite::Memoize::Alias for more speed
|
12
|
-
- Rename zscore to zscores
|
13
16
|
- Rework benchmarks
|
14
17
|
|
15
18
|
## [1.0.0] - 2019-07-13
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -80,7 +80,7 @@ Ex: `variance` => `sample_variance`
|
|
80
80
|
* [Sample|Population Standard Deviation](https://github.com/drexed/lite-statistics/blob/master/docs/descriptive/STANDARD_DEVIATION.md)
|
81
81
|
* [Sample|Population Coefficient of Variation](https://github.com/drexed/lite-statistics/blob/master/docs/descriptive/COEFFICIENT_OF_VARIATION.md)
|
82
82
|
* [Sample|Population Standard Error](https://github.com/drexed/lite-statistics/blob/master/docs/descriptive/STANDARD_ERROR.md)
|
83
|
-
* [Sample|Population Z-
|
83
|
+
* [Sample|Population Z-Scores](https://github.com/drexed/lite-statistics/blob/master/docs/descriptive/ZSCORES.md)
|
84
84
|
|
85
85
|
#### Shape
|
86
86
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
# Sample|Population Z-
|
1
|
+
# Sample|Population Z-Scores
|
2
2
|
|
3
|
-
Alias: `
|
3
|
+
Alias: `zscores`
|
4
4
|
|
5
5
|
```ruby
|
6
6
|
collection = [1, 1, 2, 3, 10]
|
@@ -12,13 +12,13 @@ results = {
|
|
12
12
|
}
|
13
13
|
|
14
14
|
klass = Lite::Statistics::Descriptive.new(collection)
|
15
|
-
klass.
|
15
|
+
klass.sample_zscores
|
16
16
|
|
17
17
|
# - or -
|
18
18
|
|
19
|
-
Lite::Statistics::Descriptive.
|
19
|
+
Lite::Statistics::Descriptive.population_zscores(collection)
|
20
20
|
|
21
21
|
# - or -
|
22
22
|
|
23
|
-
collection.
|
23
|
+
collection.sample_zscores
|
24
24
|
```
|
@@ -10,9 +10,9 @@ module Lite
|
|
10
10
|
frequencies max mean median midrange min mode proportions percentile_from_value
|
11
11
|
population_coefficient_of_variation population_kurtosis population_size population_skewness
|
12
12
|
population_standard_deviation population_standard_error population_summary
|
13
|
-
population_variance
|
13
|
+
population_variance population_zscores range sample_coefficient_of_variation sample_kurtosis
|
14
14
|
sample_size sample_skewness sample_standard_deviation sample_standard_error sample_summary
|
15
|
-
sample_variance
|
15
|
+
sample_variance sample_zscores sum value_from_percentile
|
16
16
|
].freeze
|
17
17
|
|
18
18
|
def initialize(collection)
|
@@ -157,7 +157,7 @@ module Lite
|
|
157
157
|
population_standard_deviation: population_standard_deviation,
|
158
158
|
population_standard_error: population_standard_error,
|
159
159
|
population_variance: population_variance,
|
160
|
-
|
160
|
+
population_zscores: population_zscores
|
161
161
|
)
|
162
162
|
end
|
163
163
|
|
@@ -169,7 +169,7 @@ module Lite
|
|
169
169
|
|
170
170
|
memoize :population_variance
|
171
171
|
|
172
|
-
def
|
172
|
+
def population_zscores
|
173
173
|
return if size < 2
|
174
174
|
return Hash.new(0) if population_standard_deviation.zero?
|
175
175
|
|
@@ -178,7 +178,7 @@ module Lite
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
|
181
|
-
memoize :
|
181
|
+
memoize :population_zscores
|
182
182
|
|
183
183
|
def midrange
|
184
184
|
return if @collection.empty?
|
@@ -270,7 +270,7 @@ module Lite
|
|
270
270
|
sample_standard_deviation: sample_standard_deviation,
|
271
271
|
sample_standard_error: sample_standard_error,
|
272
272
|
sample_variance: sample_variance,
|
273
|
-
|
273
|
+
sample_zscores: sample_zscores
|
274
274
|
)
|
275
275
|
end
|
276
276
|
|
@@ -285,8 +285,7 @@ module Lite
|
|
285
285
|
memoize :sample_variance
|
286
286
|
alias variance sample_variance
|
287
287
|
|
288
|
-
|
289
|
-
def sample_zscore
|
288
|
+
def sample_zscores
|
290
289
|
return if size < 2
|
291
290
|
return Hash.new(0) if sample_standard_deviation.zero?
|
292
291
|
|
@@ -295,8 +294,8 @@ module Lite
|
|
295
294
|
end
|
296
295
|
end
|
297
296
|
|
298
|
-
memoize :
|
299
|
-
alias
|
297
|
+
memoize :sample_zscores
|
298
|
+
alias zscores sample_zscores
|
300
299
|
|
301
300
|
def sum
|
302
301
|
@collection.sum
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -183,7 +183,7 @@ files:
|
|
183
183
|
- docs/descriptive/SUMMARY.md
|
184
184
|
- docs/descriptive/VALUE_FROM_PERCENTILE.md
|
185
185
|
- docs/descriptive/VARIANCE.md
|
186
|
-
- docs/descriptive/
|
186
|
+
- docs/descriptive/ZSCORES.md
|
187
187
|
- lib/generators/lite/statistics/install_generator.rb
|
188
188
|
- lib/generators/lite/statistics/templates/install.rb
|
189
189
|
- lib/lite/statistics.rb
|