Class: Apache::Stat::Inference::Chi_square

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-band/apache/stat/inference.rb

Overview

Utility class called by ‘chi_square’ method in this same package

Class Method Summary collapse

Class Method Details

.chi_square_2d(array_2d) ⇒ Object



30
31
32
33
34
35
# File 'lib/ruby-band/apache/stat/inference.rb', line 30

def self.chi_square_2d(array_2d)
  obj = ChiSquareTest.new
  val = obj.chi_square(array_2d.to_java(Java::long[]))
  p_value =  obj.chi_square_test(array_2d.to_java(Java::long[]))
  return val,p_value
end

.chi_square_two_arrays(expected, observed) ⇒ Object



37
38
39
40
41
42
# File 'lib/ruby-band/apache/stat/inference.rb', line 37

def self.chi_square_two_arrays(expected,observed)
  obj = ChiSquareTest.new
  val = obj.chi_square(expected.to_java(:double),observed.to_java(:long))
  p_value = obj.chi_square_test(expected.to_java(:double),observed.to_java(:long))
  return val,p_value
end