Class: Num4TstStatistic2Lib::ParametrixTestLib
- Inherits:
-
Object
- Object
- Num4TstStatistic2Lib::ParametrixTestLib
- Defined in:
- lib/num4tststatistic2.rb
Overview
パラメトリック検定
Instance Method Summary collapse
-
#diffPopulationMean(xi1, xi2, a) ⇒ boolean
対応のある2つの母平均の差の検定量.
-
#diffPopulationMean2EquVar(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(等分散性を仮定).
-
#diffPopulationMean2UnEquVar(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(不等分散性を仮定).
-
#diffPopulationRatio(m1, n1, m2, n2, a) ⇒ boolean
2つの母比率の差の検定.
-
#diffPopulationVar(xi1, xi2, a) ⇒ boolean
2つの母分散の差の検定.
-
#diffPopulationVarMean(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(等分散性check有り).
-
#fidelity(fi, pi, a) ⇒ boolean
適合度の検定.
-
#independency(fij, a) ⇒ boolean
独立性の検定.
-
#initialize(hypothTest3) ⇒ ParametrixTestLib
constructor
A new instance of ParametrixTestLib.
-
#populationMean(xi, m0, a) ⇒ boolean
正規母集団の母平均の検定.
-
#populationRatio(m, n, p0, a) ⇒ boolean
母比率の検定.
-
#populationVar(xi, sig0, a) ⇒ boolean
正規母集団の母分散の検定.
Constructor Details
#initialize(hypothTest3) ⇒ ParametrixTestLib
Returns a new instance of ParametrixTestLib.
8 9 10 11 |
# File 'lib/num4tststatistic2.rb', line 8 def initialize(hypothTest3) @hypothTest3 = hypothTest3 @paraTest = Num4TstStatisticLib::ParametrixTestLib.new end |
Instance Method Details
#diffPopulationMean(xi1, xi2, a) ⇒ boolean
対応のある2つの母平均の差の検定量
153 154 155 156 157 158 159 160 161 |
# File 'lib/num4tststatistic2.rb', line 153 def diffPopulationMean(xi1, xi2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) raise RangeError unless xi1.size == xi2.size n = xi1.size df = n - 1 statistic = @paraTest.diffPopulationMean(xi1, xi2) return @hypothTest3.tDistTest(statistic, df, a) end |
#diffPopulationMean2EquVar(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(等分散性を仮定)
109 110 111 112 113 114 115 116 117 |
# File 'lib/num4tststatistic2.rb', line 109 def diffPopulationMean2EquVar(xi1, xi2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) n1 = xi1.size n2 = xi2.size df = n1 + n2 - 2 statistic = @paraTest.diffPopulationMean2EquVar(xi1, xi2) return @hypothTest3.tDistTest(statistic, df, a) end |
#diffPopulationMean2UnEquVar(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(不等分散性を仮定)
132 133 134 135 136 137 138 |
# File 'lib/num4tststatistic2.rb', line 132 def diffPopulationMean2UnEquVar(xi1, xi2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) df = @paraTest.df4welch(xi1, xi2) statistic = @paraTest.diffPopulationMean2UnEquVar(xi1, xi2) return @hypothTest3.tDistTest(statistic, df, a) end |
#diffPopulationRatio(m1, n1, m2, n2, a) ⇒ boolean
2つの母比率の差の検定
198 199 200 201 202 203 |
# File 'lib/num4tststatistic2.rb', line 198 def diffPopulationRatio(m1, n1, m2, n2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @paraTest.diffPopulationRatio(m1, n1, m2, n2) return @hypothTest3.normDistTest(statistic, a) end |
#diffPopulationVar(xi1, xi2, a) ⇒ boolean
2つの母分散の差の検定
176 177 178 179 180 181 182 183 |
# File 'lib/num4tststatistic2.rb', line 176 def diffPopulationVar(xi1, xi2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) nf = xi1.size - 1 df = xi2.size - 1 statistic = @paraTest.diffPopulationVar(xi1, xi2) return @hypothTest3.fDistTest(statistic, nf, df, a) end |
#diffPopulationVarMean(xi1, xi2, a) ⇒ boolean
2つの母平均の差の検定(等分散性check有り)
86 87 88 89 90 91 92 93 94 |
# File 'lib/num4tststatistic2.rb', line 86 def diffPopulationVarMean(xi1, xi2, a) bRet = diffPopulationVar(xi1, xi2, a) if bRet == true # 等分散ではない return diffPopulationMean2UnEquVar(xi1, xi2, a) else # 等分散性 return diffPopulationMean2EquVar(xi1, xi2, a) end end |
#fidelity(fi, pi, a) ⇒ boolean
適合度の検定
218 219 220 221 222 223 224 |
# File 'lib/num4tststatistic2.rb', line 218 def fidelity(fi, pi, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) df = fi.size - 1 statistic = @paraTest.fidelity(fi, pi) return @hypothTest3.chi2DistTest(statistic, df, a) end |
#independency(fij, a) ⇒ boolean
独立性の検定
240 241 242 243 244 245 246 247 248 |
# File 'lib/num4tststatistic2.rb', line 240 def independency(fij, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) m = fij.size n = fij[0].size df = (m - 1) * (n - 1) statistic = @paraTest.independency(fij) return @hypothTest3.chi2DistTest(statistic, df, a) end |
#populationMean(xi, m0, a) ⇒ boolean
正規母集団の母平均の検定
25 26 27 28 29 30 31 |
# File 'lib/num4tststatistic2.rb', line 25 def populationMean(xi, m0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) df = xi.size - 1 statistic = @paraTest.populationMean(xi, m0) return @hypothTest3.tDistTest(statistic, df, a) end |
#populationRatio(m, n, p0, a) ⇒ boolean
母比率の検定
66 67 68 69 70 71 |
# File 'lib/num4tststatistic2.rb', line 66 def populationRatio(m, n, p0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @paraTest.populationRatio(m, n, p0) return @hypothTest3.normDistTest(statistic, a) end |
#populationVar(xi, sig0, a) ⇒ boolean
正規母集団の母分散の検定
46 47 48 49 50 51 52 |
# File 'lib/num4tststatistic2.rb', line 46 def populationVar(xi, sig0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) df = xi.size - 1 statistic = @paraTest.populationVar(xi, sig0) return @hypothTest3.chi2DistTest(statistic, df, a) end |