Class: Num4TstStatistic2Lib::OutlierLib

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

Overview

外れ値検定

Instance Method Summary collapse

Constructor Details

#initializeOutlierLib

Returns a new instance of OutlierLib.



317
318
319
320
# File 'lib/num4tststatistic2.rb', line 317

def initialize
    @outlier = Num4TstStatisticLib::OutlierLib.new
    @hypothTest2 = Num4HypothTestLib::GrubbsTestLib.new
end

Instance Method Details

#errbar(dname, xi) ⇒ void

エラーバー出力

Examples:

xi = [3.4, 3.5, 3.3, 2.2, 3.3, 3.4, 3.6, 3.2]
outlier = Num4TstStatistic2Lib::OutlierLib.new
outlier.errbar("LDH", xi)
=> errbar.jpeg

This method returns an undefined value.

Returns errbar.jpegファイルを出力.

Parameters:

  • dname (String)

    データ名

  • xi (Array)

    xiのデータ(double[])



348
349
350
# File 'lib/num4tststatistic2.rb', line 348

def errbar(dname, xi)
    @outlier.errbar(dname, xi)
end

#grubbs(xi, xk, a) ⇒ double

グラプス・スミルノフの外れ値の検定

Examples:

xi = [3.4, 3.5, 3.3, 2.2, 3.3, 3.4, 3.6, 3.2]
outlier = Num4TstStatistic2Lib::OutlierLib.new
outlier.grubbs(xi, 2.2, 0.05)
=> true

Returns 検定統計量.

Parameters:

  • xi (Array)

    xiのデータ(double[])

  • xk (double)

    外れ値

Returns:

  • (double)

    検定統計量



332
333
334
335
336
# File 'lib/num4tststatistic2.rb', line 332

def grubbs(xi, xk, a)
    n = xi.size
    statistic = @outlier.grubbs(xi, xk)
    @hypothTest2.twoSideTest(statistic, n, a)
end