Class: Num4TstStatisticLib::NonParametrixTestLib

Inherits:
Object
  • Object
show all
Defined in:
lib/num4tststatistic.rb

Instance Method Summary collapse

Constructor Details

#initializeNonParametrixTestLib

Returns a new instance of NonParametrixTestLib.



233
234
235
# File 'lib/num4tststatistic.rb', line 233

def initialize
    @nonParamTest = NonParametrixTest.getInstance()
end

Instance Method Details

#kendallscorr(x, y) ⇒ double

Note:

無相関検定

ケンドールの順位相関係数

Examples:

x = [113, 64, 16, 45, 28, 19, 30, 82, 76]
y = [31, 5, 2, 17, 18, 2, 9, 25, 13]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
nonParaTest.kendallscorr(x, y)
=> 0.592

Returns 相関係数.

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

Returns:

  • (double)

    相関係数



301
302
303
# File 'lib/num4tststatistic.rb', line 301

def kendallscorr(x, y)
    return @nonParamTest.kendallscorr(x.to_java(Java::double), y.to_java(Java::double))
end

#ks2test(xi1, xi2, a) ⇒ boolean

Note:

N1+N2-2のt分布に従う

コルモゴルフ・スミルノフ検定(2標本)

Examples:

xi1 = [165, 130, 182, 178, 194, 206, 160, 122, 212, 165, 247, 195]
xi2 = [180, 180, 235, 270, 240, 285, 164, 152]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
nonParaTest.ks2test(xi1, xi2, 0.05)
=> false

Returns 検定結果(true:棄却域内 false:棄却域外).

Parameters:

  • xi1 (Array)

    x1のデータ(double[])

  • xi2 (Array)

    x2のデータ(double[])

  • a (double)

    有意水準

Returns:

  • (boolean)

    検定結果(true:棄却域内 false:棄却域外)



319
320
321
# File 'lib/num4tststatistic.rb', line 319

def ks2test(xi1, xi2, a)
    return @nonParamTest.ks2test(xi1.to_java(Java::double), xi2.to_java(Java::double), a)
end

#spearmanscorr(x, y) ⇒ double

Note:

無相関検定

スピアマンの順位相関係数

Examples:

x = [113, 64, 16, 45, 28, 19, 30, 82, 76]
y = [31, 5, 2, 17, 18, 2, 9, 25, 13]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
nonParaTest.spearmanscorr(x, y)
=> 0.745

Returns 相関係数.

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

Returns:

  • (double)

    相関係数



284
285
286
# File 'lib/num4tststatistic.rb', line 284

def spearmanscorr(x, y)
    return @nonParamTest.spearmanscorr(x.to_java(Java::double), y.to_java(Java::double))
end

#utest(x, y) ⇒ double

Note:

近似的に標準正規分布 N(0,1*1)に従う

マン・ホイットニーのU検定

Examples:

x = [165, 130, 182, 178, 194, 206, 160, 122, 212, 165, 247, 195]
y = [180, 180, 235, 270, 240, 285, 164, 152]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
nonParaTest.utest(x, y)
=> 63.0

Returns 検定統計量.

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

Returns:

  • (double)

    検定統計量



250
251
252
# File 'lib/num4tststatistic.rb', line 250

def utest(x, y)
    return @nonParamTest.utest(x.to_java(Java::double), y.to_java(Java::double))
end

#wilcoxontest(x, y) ⇒ double

Note:

近似的に標準正規分布 N(0,1*1)に従う

ウィルコクス符号付き順位検定

Examples:

x = [37.1, 36.2, 36.6, 37.4, 36.8, 36.7, 36.9, 37.4, 36.6, 36.7]
y = [36.8, 36.6, 36.5, 37.0, 36.0, 36.5, 36.6, 37.1, 36.4, 36.7]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
nonParaTest.wilcoxon(x, y)
=> 46.5

Returns 検定統計量.

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

Returns:

  • (double)

    検定統計量



267
268
269
# File 'lib/num4tststatistic.rb', line 267

def wilcoxon(x, y)
    return @nonParamTest.wilcoxon(x.to_java(Java::double), y.to_java(Java::double))
end