class Malge::ErrorFittedFunction::AXInv4
Assumed y = a/(x**4)
Public Instance Methods
equation()
click to toggle source
# File lib/malge/errorfittedfunction/axinv4.rb, line 13 def equation sprintf("%f / (x**4)", * @coefficients) end
expected_error(x)
click to toggle source
# File lib/malge/errorfittedfunction/axinv4.rb, line 17 def expected_error(x) @coefficients[0] / (x**4) end
fit()
click to toggle source
# File lib/malge/errorfittedfunction/axinv4.rb, line 8 def fit inv_pairs = @diff_abs_pairs.map {|pair| [1.0/(pair[0]**4), pair[1]]} @coefficients = Malge::LeastSquare.least_square_proportional(inv_pairs) end
most_strict_pair()
click to toggle source
# File lib/malge/errorfittedfunction/axinv4.rb, line 27 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/axinv4.rb, line 23 def x(y) return (@coefficients[0] / y) ** (1.0/4.0) end