Module: Statsample::Test::ChiSquare::Shared

Included in:
WithMatrix, WithVector
Defined in:
lib/statsample/test/chisquare.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dfObject (readonly)

Returns the value of attribute df.



5
6
7
# File 'lib/statsample/test/chisquare.rb', line 5

def df
  @df
end

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/statsample/test/chisquare.rb', line 6

def value
  @value
end

Instance Method Details

#chi_squareObject



12
13
14
# File 'lib/statsample/test/chisquare.rb', line 12

def chi_square
  @value
end

#probabilityObject



16
17
18
# File 'lib/statsample/test/chisquare.rb', line 16

def probability
  1-Distribution::ChiSquare.cdf(@value.to_f,@df)
end

#to_fObject



8
9
10
# File 'lib/statsample/test/chisquare.rb', line 8

def to_f
  @value
end