Class: Num4TstStatistic2Lib::OutlierLib

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

Instance Method Summary collapse

Constructor Details

#initializeOutlierLib

Returns a new instance of OutlierLib.



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

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 = Num4TstStatisticLib::OutlierLib.new
outlier.grubbs("LDH", xi)
=> errbar.jpeg

This method returns an undefined value.

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

Parameters:

  • dname (String)

    データ名

  • xi (Array)

    xiのデータ(double[])



298
299
300
# File 'lib/num4tststatistic2.rb', line 298

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 = Num4TstStatisticLib::OutlierLib.new
outlier.grubbs(xi, 2.2, 0.05)
=> true

Returns 検定統計量.

Parameters:

  • xi (Array)

    xiのデータ(double[])

  • xk (double)

    外れ値

Returns:

  • (double)

    検定統計量



282
283
284
285
286
# File 'lib/num4tststatistic2.rb', line 282

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