Class: DecorrTestLib::CorreFactLib
- Inherits:
-
CorreFactIF
- Object
- CorreFactIF
- DecorrTestLib::CorreFactLib
- Defined in:
- lib/num4tststatistic2.rb
Overview
相関係数の検定
Instance Method Summary collapse
-
#initialize(hypothTest3) ⇒ CorreFactLib
constructor
A new instance of CorreFactLib.
-
#kendallscorr(x, y, rth0, a) ⇒ boolean
ケンドールの順位相関係数.
-
#pearsoCorrelation(x, y, rth0, a) ⇒ boolean
ピアソン相関係数.
-
#spearmanscorr(x, y, rth0, a) ⇒ boolean
スピアマンの順位相関係数.
Constructor Details
#initialize(hypothTest3) ⇒ CorreFactLib
Returns a new instance of CorreFactLib.
419 420 421 422 423 |
# File 'lib/num4tststatistic2.rb', line 419 def initialize(hypothTest3) @hypothTest3 = hypothTest3 @paraTest = Num4TstStatisticLib::ParametrixTestLib.new @nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new end |
Instance Method Details
#kendallscorr(x, y, rth0, a) ⇒ boolean
ケンドールの順位相関係数
479 480 481 482 483 |
# File 'lib/num4tststatistic2.rb', line 479 def kendallscorr(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @nonParaTest.kendallscorr(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |
#pearsoCorrelation(x, y, rth0, a) ⇒ boolean
ピアソン相関係数
439 440 441 442 443 |
# File 'lib/num4tststatistic2.rb', line 439 def pearsoCorrelation(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @paraTest.pearsoCorrelation(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |
#spearmanscorr(x, y, rth0, a) ⇒ boolean
スピアマンの順位相関係数
459 460 461 462 463 |
# File 'lib/num4tststatistic2.rb', line 459 def spearmanscorr(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @nonParaTest.spearmanscorr(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |