Class: Invariant::Targeted
- Inherits:
-
Invariant
- Object
- Invariant
- Invariant::Targeted
- Defined in:
- lib/quantile_estimator/invariant.rb
Instance Method Summary (collapse)
-
- (Targeted) initialize(target_values)
constructor
A new instance of Targeted.
- - (Object) upper_bound(rank, n)
Constructor Details
- (Targeted) initialize(target_values)
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
- (Object) upper_bound(rank, n)
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 |