Class: Invariant::Targeted

Inherits:
Invariant show all
Defined in:
lib/quantile_estimator/invariant.rb

Instance Method Summary collapse

Constructor Details

#initialize(target_values) ⇒ Targeted

Returns a new instance of Targeted.



34
35
36
37
38
39
# File 'lib/quantile_estimator/invariant.rb', line 34

def initialize(target_values)
  @targets = target_values.map { |target_value|
    phi, epsilon = target_value
    SingleTarget.new(phi, epsilon)
  }
end

Instance Method Details

#upper_bound(rank, n) ⇒ Object



41
42
43
44
45
# File 'lib/quantile_estimator/invariant.rb', line 41

def upper_bound(rank, n)
  @targets.map { |target|
    target.upper_bound(rank, n)
  }.min
end