lib/darkext/statistics.rb in darkhelmet-darkext-0.11.2 vs lib/darkext/statistics.rb in darkhelmet-darkext-0.12.0
- old
+ new
@@ -71,10 +71,10 @@
end
# Generates a confidence interval
def ci(opts = { })
raise ArgumentError.new('Array size must be > 0') if self.size.zero?
- opts.with_defaults!({ :percent => 0.95, :rho => 1, :type => :center })
+ opts = { :percent => 0.95, :rho => 1, :type => :center }.merge(opts)
percent = opts[:percent]
rho = opts[:rho]
m = self.mean
ret = Array.new
div = (opts[:type] == :center ? 2 : 1)