erv 0.3.4 → 0.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 603f059bcc653dec48f6f20f7f451d63fa1a56cfc3bcc13dd425e7af9074ea85
4
- data.tar.gz: cf66f1926b9417926f8cae463606171c7e42866b1069e53d0f9bd88a8c10d2c7
3
+ metadata.gz: a373b6d772167ba3c442980aa0ebef57fe3f06c686eb52022d7b7f52b46f3da2
4
+ data.tar.gz: 48cbe39fa60eeb16323437717816563b4f95c16827251c3b7fa76a3f59931d34
5
5
  SHA512:
6
- metadata.gz: 8ee227008ef4b7ac84d956cc93a5b0e637146a579df9700f6f74fc0cabaec451e0a0bcd7205b8b9a576bb95c4bc77fdd3f55c222fda8fb7bc251ae539b9fc5e2
7
- data.tar.gz: 560c161b2809c89adcb0348df4b778e5fa9656923e47dfe6efb8165e20b7cc01e9c117530255266c0da0f9a7cf007f5f7e1380c76b8d81958fc8b5b57a0d9478
6
+ metadata.gz: fd33198c89901219af7bdfef38383cc2d3d4f9ce47f43ce27a2b33231d6ae4f9901c78ffd1cd67a6a2a25e863f6dd9d9f2b8efcc6221a663c11efd7cac34e641
7
+ data.tar.gz: 2a4618d56f415822b4a67f3b21e87fa19bb28281d88836f0f63a5e14adc3caca4f6b4c64fff62a4b6897ff49e97303e4f5888c95f318981b7bf25da6733f426e
@@ -23,7 +23,7 @@ module ERV
23
23
  end
24
24
 
25
25
  @variance = if @shape < 0.5
26
- (@scale ** 2.0) / (1.0 - @shape) ** 2 / (1.0 - 2 * @shape)
26
+ (@scale ** 2.0) / (((1.0 - @shape) ** 2) * (1.0 - 2 * @shape))
27
27
  else
28
28
  Infinity
29
29
  end
@@ -15,7 +15,8 @@ module ERV
15
15
 
16
16
  @mixture = []
17
17
  weight_sum = 0.0
18
- while dist_conf = confs.shift
18
+ confs.each do |x|
19
+ dist_conf = x.dup
19
20
  # get weight ...
20
21
  weight = dist_conf.delete(:weight).to_f
21
22
 
@@ -40,7 +40,8 @@ module ERV
40
40
 
41
41
  class SequentialRandomVariable
42
42
 
43
- def initialize(args={})
43
+ def initialize(opts={})
44
+ args = opts.dup
44
45
  first = args.delete(:first_value)
45
46
  raise ArgumentError, "First value must be provided!" if first.nil?
46
47
  @most_recent = first.to_f
@@ -1,3 +1,3 @@
1
1
  module ERV
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauro Tortonesi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-30 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.0.3
83
- description: erv-0.3.4
83
+ description: erv-0.3.5
84
84
  email:
85
85
  - mauro.tortonesi@unife.it
86
86
  executables: []