class Malge::ErrorFittedFunction::AXInv32

Assumed y = a /x**{3/2}

NOTE: @coefficients might become negative value.

Need discussion for dealing?

Public Instance Methods

equation() click to toggle source
# File lib/malge/errorfittedfunction/axinv32.rb, line 15
def equation
  sprintf("%f / (x**(3.0/2.0))", * @coefficients)
end
expected_error(x) click to toggle source
# File lib/malge/errorfittedfunction/axinv32.rb, line 19
def expected_error(x)
  @coefficients[0] /(x** (3.0/2.0))
end
fit() click to toggle source
# File lib/malge/errorfittedfunction/axinv32.rb, line 10
def fit
  inv32_pairs = @diff_abs_pairs.map {|pair| [pair[0] ** ( - 3.0/2.0), pair[1]]}
  @coefficients = Malge::LeastSquare.least_square_proportional(inv32_pairs)
end
most_strict_pair() click to toggle source
# File lib/malge/errorfittedfunction/axinv32.rb, line 32
def most_strict_pair
  @raw_pairs.max_by{ |pair| pair[0] }
end
x(y) click to toggle source
y = a[0]/x**{3/2}
y = a[0]/x**{3/2}

x**{3/2} y = a

x**{3/2} = a[0]/y
            x = (a[0]/y)**{2/3}
# File lib/malge/errorfittedfunction/axinv32.rb, line 28
def x(y)
  return (@coefficients[0] / y ) ** (2.0/3.0)
end