Class: Byar

Inherits:
Object
  • Object
show all
Defined in:
lib/byar.rb

Class Method Summary collapse

Class Method Details

.lower(obs, exp) ⇒ Object



2
3
4
5
6
# File 'lib/byar.rb', line 2

def self.lower(obs, exp)
  return nil if exp == 0
  return 0 if obs == 0
  obs.quo(exp) * (1 - 1.quo(9 * obs) - 1.96.quo(3 * Math.sqrt(obs))) ** 3
end

.upper(obs, exp) ⇒ Object



8
9
10
11
12
# File 'lib/byar.rb', line 8

def self.upper(obs, exp)
  return nil if exp == 0
  obs = obs + 1
  (obs).quo(exp) * (1 - 1.quo(9 * (obs)) + 1.96.quo(3 * Math.sqrt(obs))) ** 3
end