BaringhausHenzeTest[data]
Baringhaus–Henze検定を使い,データがMultinormalDistributionに従っているかどうかの検定を行う.
BaringhausHenzeTest[data,MultinormalDistribution[μ,Σ]]
データが,平均ベクトル μ,共分散行列 Σ で分布に従っているかどうかの検定を行う.
BaringhausHenzeTest[data,"property"]
"property"の値を返す.
BaringhausHenzeTest
BaringhausHenzeTest[data]
Baringhaus–Henze検定を使い,データがMultinormalDistributionに従っているかどうかの検定を行う.
BaringhausHenzeTest[data,MultinormalDistribution[μ,Σ]]
データが,平均ベクトル μ,共分散行列 Σ で分布に従っているかどうかの検定を行う.
BaringhausHenzeTest[data,"property"]
"property"の値を返す.
詳細とオプション
- BaringhausHenzeTestは,data がMultinormalDistributionから取られたという帰無仮説
とそうではないという対立仮説
で適合度検定を実行する. - BaringhausHenzeTestは,Baringhaus–Henze–Epps–Pulley多変量正規性検定,つまりBHEP検定としても知られている.
- デフォルトで,確率値すなわち
値が返される. - 小さい
値は data が多変量正規分布から来ている可能性が低いことを示す. - data は,一変量{x1,…,xn}あるいは多変量{{x1,y1,…},…,{xn,yn,…}}でよい.
- Baringhaus–Henze検定は,事実上,無相関化された標準化 data と標準多変量ガウス特性関数Tβ=Expectation[n Abs[Ψemp[t]-Ψst[t]]2,{t1,…,td}]の間の距離
に基づく経験特性関数検定統計 Tβを使う.ただし,=ProductDistribution[{NormalDistribution[0,β],d}]である. » - β 母数は正で,経験分布の平滑化を決定する.これは自動的に決定されるが,Method設定で変えることもできる.
- BaringhausHenzeTest[data,MultinormalDistribution[μ,Σ],"HypothesisTestData"]はHypothesisTestDataオブジェクト htd を返す.これは,htd["property"]として追加的な検定結果および特性の抽出に使うことができる.
- BaringhausHenzeTest[data,MultinormalDistribution[μ,Σ],"property"]を使って直接"property"の値を与えることができる.
- 検定結果のレポートに関連する特性
-
"PValue"
値"PValueTable" "PValue"のフォーマットされたバージョン "ShortTestConclusion" 検定結果の簡単な説明 "TestConclusion" 検定結果の説明 "TestData" 検定統計と
値"TestDataTable" "TestData"のフォーマットされたバージョン "TestStatistic" 検定統計 "TestStatisticTable" フォーマットされた"TestStatistic" - 次の特性はどの検定が行われているかに依存しない.
- データ分布に関連する特性
-
"FittedDistribution" データのフィットした分布 "FittedDistributionParameters" データの分布母数 - 使用可能なオプション
-
Method Automatic
値を計算するメソッドSignificanceLevel 0.05 診断とレポートのための切捨て - 適合度検定では,
のときにのみ
が棄却されるような切捨て
が選択される.特性"TestConclusion"および"ShortTestConclusion"で使われる
の値はSignificanceLevelオプションで制御される.デフォルトで,
は0.05に設定されている. » - Method->"MonteCarlo"の設定では,入力
と同じ長さのデータ集合が,フィットされた分布を使って
のもとで生成される.次に,BaringhausHenzeTest[si,"TestStatistic"]からのEmpiricalDistributionを使って
値が推定される. » - Method{method,"SmoothingParameter"β}と設定すると,カスタムの平滑化母数 β を使うことができる.デフォルトは
である.この場合,検定はHenze-Zirkler検定としても知られるものになる. »
例題
すべて開く すべて閉じる例 (3)
data = RandomVariate[BinormalDistribution[1 / 2], 1000];BaringhausHenzeTest[data]Baringhaus–Henze検定から検定統計を抽出する:
data = RandomVariate[MultinormalDistribution[{1, 2, 3}, {{2, 1, 0}, {1, 3, -1}, {0, -1, 1}}], 1000];BaringhausHenzeTest[data, "TestStatistic"]data = RandomVariate[ProductDistribution[BinormalDistribution[2 / 3], BinormalDistribution[-1 / 2]], 1000];BaringhausHenzeTest[data, "TestDataTable"]スコープ (6)
検定 (3)
一変量の正規性についてBaringhaus–Henze検定を行う:
data1 = RandomVariate[NormalDistribution[], 1000];
data2 = RandomVariate[StudentTDistribution[4], 1000];BaringhausHenzeTest[data1]BaringhausHenzeTest[data2]多変量の正規性についてBaringhaus–Henze検定を行う:
data1 = RandomVariate[MultinormalDistribution[{0, 0, 0}, {{3, 2, 1}, {2, 4, 0}, {1, 0, 2}}], 1000];
data2 = RandomVariate[MultivariateTDistribution[{{3, 2, 1}, {2, 4, 0}, {1, 0, 2}}, 6], 1000];BaringhausHenzeTest[data1]BaringhausHenzeTest[data2]関連特性の抽出のためにHypothesisTestDataオブジェクトを作る:
data = RandomVariate[BinormalDistribution[-0.5], 10^3];ℋ = BaringhausHenzeTest[data, "HypothesisTestData"]ℋ["Properties"]レポート (3)
data = RandomVariate[BinormalDistribution[.5], 10^3];ℋ = BaringhausHenzeTest[data, "HypothesisTestData"];ℋ["TestDataTable"]ℋ["PValueTable"]ℋ["TestStatisticTable"]カスタマイズされたレポート用にBaringhaus–Henze検定の表から項目を取り出す:
data1 = RandomVariate[BinormalDistribution[.5], 10^3];
data2 = RandomVariate[BinormalDistribution[.5], 10^3];ℋ1 = BaringhausHenzeTest[data1, "TestData"]ℋ2 = BaringhausHenzeTest[data2, "TestData"]BarChart[{Labeled[ℋ1, "Set 1"], Labeled[ℋ2, "Set 2"]}, ChartLabels -> {"Statistic", "p‐value"}]"ShortTestConclusion"と"TestConclusion"を使って検定の結論をレポートする:
data = BlockRandom[SeedRandom[1];RandomVariate[StudentTDistribution[4], {100, 2}]];ℋ = BaringhausHenzeTest[data, "HypothesisTestData"];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormℋ = BaringhausHenzeTest[data, "HypothesisTestData", SignificanceLevel -> .001];ℋ["ShortTestConclusion"]ℋ["TestConclusion"]//TraditionalFormオプション (3)
Method (2)
Baringhaus–Henze検定に使われる平滑化母数 β を設定する:
BlockRandom[SeedRandom["fixed"];data = RandomVariate[BinormalDistribution[2 / 3], 1000];]pvls = Table[{beta, BaringhausHenzeTest[data, Method -> {Automatic, "SmoothingParameter" -> beta}]}, {beta, {0.05, 0.1, 0.25, 0.5, 1, 1.5, 2, 3, 5}}];ListLinePlot[pvls, FrameLabel -> {"β", "P-Value"}, Frame -> True, AxesOrigin -> {0, 0}, PlotRange -> All]モンテカルロ法に基づくメソッドで使われるランダムなシードを設定する:
data = RandomVariate[BinormalDistribution[.5], 1000];pts = Table[{i, BaringhausHenzeTest[data, Method -> {"MonteCarlo", "RandomSeed" -> i, "MonteCarloSamples" -> 100}]}, {i, Range[1, 10]}];シードは生成器の状態に影響を与え,結果の
値にもいくらか影響を与える:
Show[ListLinePlot[pts, PlotRange -> {Min[pts[[All, 2]]], Max[pts[[All, 2]]]}, FrameLabel -> {"Seed", "P-Value"}, Frame -> True, AxesOrigin -> {0, 0}]]モンテカルロ法と検定母数 β のカスタム設定を使って
値を求める:
BaringhausHenzeTest[data, Method -> {"MonteCarlo", "MonteCarloSamples" -> 100, "SmoothingParameter" -> 0.25}]BaringhausHenzeTest[data, Method -> {Automatic, "SmoothingParameter" -> 0.25}]SignificanceLevel (1)
"TestConclusion"と"ShortTestConclusion"で使う有意水準を設定する:
data = BlockRandom[SeedRandom[2];RandomVariate[StudentTDistribution[5], {100, 2}]];BaringhausHenzeTest[data, "ShortTestConclusion", SignificanceLevel -> .1]BaringhausHenzeTest[data, "ShortTestConclusion", SignificanceLevel -> .25]BaringhausHenzeTest[data, "TestConclusion"]//TraditionalFormアプリケーション (4)
Baringhaus–Henze検定の検出力曲線(
が偽であるときにこれを拒絶する確率):
data = Table[RandomVariate[MultivariateTDistribution[IdentityMatrix[2], 3], {1000, i}], {i, n = Range[10, 50, 5]}];ℋ = Map[BaringhausHenzeTest, data, {2}];pC = Interpolation[Transpose[{n, Table[Probability[x ≤ 0.05, xi], {i, ℋ}]}], InterpolationOrder -> 1];Plot[pC[x], {x, 10, 50}, PlotRange -> {0, 1}, Ticks -> {n, Automatic}, AxesOrigin -> {7, 0}, AxesLabel -> {"Sample Size", "Power"}]基礎となる分布がMultivariateTDistributionであり,検定サイズが0.05,サンプルサイズが43である場合の,Baringhaus–Henze検定の検出力を推定する:
pC[43.]連続時間ランダム過程がガウス過程であるかどうかを調べる.非整数ブラウン運動:
proc1 = RandomFunction[FractionalBrownianMotionProcess[0.1, 1., 0.6], {10, 15, 0.1}, 300];BaringhausHenzeTest[proc1["ValueList"]]proc2 = RandomFunction[GeometricBrownianMotionProcess[0.1, 0.6, 1.], {10, 15, 0.1}, 300];BaringhausHenzeTest[Differences /@ Log[proc2["ValueList"]]]コックス・インガソール・ロス(Cox–Ingersoll–Ross)過程の対数の差:
proc3 = RandomFunction[CoxIngersollRossProcess[0.1, 0.6, 0.1, 1.], {10, 15, 0.1}, 300];BaringhausHenzeTest[Differences /@ Log[proc3["ValueList"]]]治療研究の前と後の患者の体重が記録されている.データが多変量正規分布に従っていれば,平均の多変量検定を使って対照群と実験群を識別することができる:
data = ExampleData[{"Statistics", "AnorexiaTreatment"}];ExampleData[{"Statistics", "AnorexiaTreatment"}, "ColumnDescriptions"]groups = data[[All, 1]];BaringhausHenzeTestを使って,データの3群が多変量正規分布に従っているかどうかを判定する:
BaringhausHenzeTest[g1 = Pick[data[[All, 2 ;; ]], groups, "Cont"], "ShortTestConclusion"]BaringhausHenzeTest[g2 = Pick[data[[All, 2 ;; ]], groups, "CBT"], "ShortTestConclusion"]BaringhausHenzeTest[g3 = Pick[data[[All, 2 ;; ]], groups, "FT"], "ShortTestConclusion"]Baringhaus–Henze検定はContおよびFTの群を棄却しなかった.TTestを使ってこの2群の平均が等しいかどうかを見る:
TTest[{g1, g3}, 0, "TestDataTable"]データが標準非相関二変量正規分布に従っているという仮説を検定する:
bhep[rho_Real] := BlockRandom[SeedRandom["example"];BaringhausHenzeTest[RandomVariate[BinormalDistribution[rho], 250], ProductDistribution[{NormalDistribution[], 2}]]]LogPlot[bhep[rho], {rho, -0.5, 0.5}, PlotRange -> {0.001, 1}]特性と関係 (5)
Baringhaus–Henze検定は,データに適用された線形変換が非特異であればアフィン不変である:
data1 = RandomVariate[NormalDistribution[], {1000, 3}];data2 = AffineTransform[{ToeplitzMatrix[3], RandomReal[1, 3]}][data1];Grid[Join[{{"BaringhausHenze Test", "statistic", "p-value"}}, MapThread[Prepend, {{BaringhausHenzeTest[data1, "TestData"], BaringhausHenzeTest[data2, "TestData"]}, {"data1", "data2"}}]], Frame -> All]正規性についてのMardiaの結合検定はもまた,同じ特性を有する:
Grid[Join[{{"Mardia Combined Test", "statistic", "p-value"}}, MapThread[Prepend, {{MardiaKurtosisTest[data1, "TestData"], MardiaKurtosisTest[data2, "TestData"]}, {"data1", "data2"}}]], Frame -> All]
のもとでは,検定統計はLogNormalDistributionに漸近的に従う:
SeedRandom[10];
n = 25;
t = Table[BaringhausHenzeTest[RandomVariate[
MultinormalDistribution[{0, 1}, ToeplitzMatrix[{2, 1}]], n], "TestStatistic"], {10 ^ 3}];検定統計がLogNormalDistribution族からの分布に従うかどうかの検定を行う:
DistributionFitTest[t, LogNormalDistribution[mu, sig], "ShortTestConclusion"]pdf = PDF[EstimatedDistribution[t, LogNormalDistribution[mu, sig]]]Show[Histogram[t, {0.05}, "PDF"], Plot[pdf[x], {x, 0, 2}]]BaringhausHenzeTest統計は,帰無仮説のもとでサンプルの経験特性関数と特性関数の間の距離に基づいている:
data = RandomVariate[NormalDistribution[], {100, 2}];StandardizeAndDecorrelate[data_] := With[{c = Transpose[Subtract[Transpose[data], Mean[data]]]},
c.Inverse[CholeskyDecomposition[Mean[Outer[Times, #, #]& /@ c]]]]cf[{t1_, t2_}] = CharacteristicFunction[EmpiricalDistribution[StandardizeAndDecorrelate[data]], {t1, t2}];d[{t1_Real, t2_Real}] := Length[data]Abs[cf[{t1, t2}] - Exp[-(t1 ^ 2 + t2 ^ 2) / 2]] ^ 2NExpectation[d[{t1, t2}], {t1NormalDistribution[0, 2], t2NormalDistribution[0, 2]}]BaringhausHenzeTestでレポートされた検定特性の値と比較する:
BaringhausHenzeTest[data, "TestStatistic", Method -> {Automatic, "SmoothingParameter" -> 2}]退化したサンプル共分散関数のサンプルについては,検定統計その最大値である4 n を与える:
htd = BaringhausHenzeTest[ConstantArray[0, {3, 2}], "HypothesisTestData"];htd["TestStatistic"]htd["PValue"]小さい値の平滑化母数 β については,Baringhaus–Henze検定は裾部の動作により敏感である:
data = RandomVariate[MultivariateTDistribution[IdentityMatrix[3], 4], {2000, 50}];bhepP[beta_Real] := BaringhausHenzeTest[#, Method -> {Automatic, "SmoothingParameter" -> beta}]& /@ dataTable[{beta, NProbability[x < 0.05, xbhepP[beta]]}, {beta, {0.05, 0.1, 0.5, 1.0, 5.0}}]Table[NProbability[x < 0.05, xtest /@ data], {test, {MardiaCombinedTest, MardiaSkewnessTest, MardiaKurtosisTest}}]おもしろい例題 (1)
bv𝒟 = TransformedDistribution[{X, (2Z - 1) X}, {XNormalDistribution[], ZBernoulliDistribution[2 / 3]}];CharacteristicFunction[MarginalDistribution[bv𝒟, 1], t] == CharacteristicFunction[MarginalDistribution[bv𝒟, 2], t] == CharacteristicFunction[NormalDistribution[], t]data = RandomVariate[bv𝒟, 1000];その成分のヒストグラムをプロットし,標準正規分布の密度関数と比較する:
GraphicsRow[Show[Histogram[#, {0.2}, "PDF"], Plot[PDF[NormalDistribution[], x], {x, -3, 3}]]& /@ Transpose[data], ImageSize -> 400]BaringhausHenzeTest[data]ListPlot[data, AspectRatio -> 1, AxesLabel -> {"SubscriptBox[X, 1]", "SubscriptBox[X, 2]"}]関連するガイド
-
▪
- 仮説検定
テキスト
Wolfram Research (2015), BaringhausHenzeTest, Wolfram言語関数, https://reference.wolfram.com/language/ref/BaringhausHenzeTest.html.
CMS
Wolfram Language. 2015. "BaringhausHenzeTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BaringhausHenzeTest.html.
APA
Wolfram Language. (2015). BaringhausHenzeTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BaringhausHenzeTest.html
BibTeX
@misc{reference.wolfram_2026_baringhaushenzetest, author="Wolfram Research", title="{BaringhausHenzeTest}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/BaringhausHenzeTest.html}", note=[Accessed: 15-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_baringhaushenzetest, organization={Wolfram Research}, title={BaringhausHenzeTest}, year={2015}, url={https://reference.wolfram.com/language/ref/BaringhausHenzeTest.html}, note=[Accessed: 15-August-2026]}