class Malge::ErrorFittedFunction::AXInv

Assumed y = a/x

Public Instance Methods

equation() click to toggle source
# File lib/malge/errorfittedfunction/axinv.rb, line 14
def equation
  sprintf("%f / x", * @coefficients)
end
expected_error(x) click to toggle source
# File lib/malge/errorfittedfunction/axinv.rb, line 18
def expected_error(x)
  @coefficients[0] / x
end
fit() click to toggle source
# File lib/malge/errorfittedfunction/axinv.rb, line 8
def fit
  inv_pairs = Marshal.load(Marshal.dump(@diff_abs_pairs))
  inv_pairs.map! {|pair| [1.0/pair[0], pair[1]]}
  @coefficients = Malge::LeastSquare.least_square_proportional(inv_pairs)
end
most_strict_pair() click to toggle source
# File lib/malge/errorfittedfunction/axinv.rb, line 28
def most_strict_pair
  @raw_pairs.max_by{ |pair| pair[0] }
end
x(y) click to toggle source

y = a/x x = a/y

# File lib/malge/errorfittedfunction/axinv.rb, line 24
def x(y)
  return @coefficients[0] / y
end