KendallTauTest[v1,v2]
ベクトル v1とベクトル v2が独立かどうかの検定を行う.
KendallTauTest[m1,m2]
行列 m1と行列 m2が独立かどうかの検定を行う.
KendallTauTest[…,"property"]
"property"の値を返す.
KendallTauTest
KendallTauTest[v1,v2]
ベクトル v1とベクトル v2が独立かどうかの検定を行う.
KendallTauTest[m1,m2]
行列 m1と行列 m2が独立かどうかの検定を行う.
KendallTauTest[…,"property"]
"property"の値を返す.
詳細とオプション
- KendallTauTestは,v1と v2に対して,ベクトルが独立であるという帰無仮説
と,そうではないという対立仮説
で仮説検定を行う. - デフォルトで,確率値つまり
値が返される. - 小さい
値は
が真である可能性が低いことを示す. - 引数 v1と v2 は任意の同じ長さの実ベクトルあるいは実行列でよい.
- KendallTauTestはKendallTau[v1,v2]で計算されたケンドール(Kendall)の順位相関
に基づいている. - 行列の検定の際,検定統計は内部の標準化された空間符号と順位の比率に基づき,ChiSquareDistribution[r*s]に漸近的に従う.ただし,r および s はそれぞれ m1および m2の次元である.
- KendallTauTest[v1,v2,"HypothesisTestData"]はHypothesisTestDataオブジェクト htd を返す.このオブジェクトは,htd["property"] の形を使った追加的な検定結果と特性の抽出に使うことができる.
- KendallTauTest[v1,v2,"property"]を使って"property"の値を直接与えることができる.
- 検定結果のレポートに関連する特性
-
"DegreesOfFreedom" 検定に使われる自由度 "PValue" 検定の
値"PValueTable"
値を含むフォーマットされた表"ShortTestConclusion" 検定結果の短い記述 "TestConclusion" 検定結果の記述 "TestData" 検定統計量と
値のリスト"TestDataTable"
値と検定統計量のフォーマットされた表"TestStatistic" 検定統計量 "TestStatisticTable" 検定統計量のフォーマットされた表 - 使用可能なオプション
-
AlternativeHypothesis "Unequal" 対立仮説のための不等式 MaxIterations Automatic 多変量検定のための最大反復回数 Method Automatic
値の計算に使うメソッドSignificanceLevel 0.05 診断とレポートのための切捨て - 独立性の検定については,
のときにのみ
が拒絶されるような切捨て
が選ばれる."TestConclusion"特性と"ShortTestConclusion"特性に使われる
の値はSignificanceLevelオプションで制御される.デフォルトで,
は0.05に設定されている.
例題
すべて開く すべて閉じる例 (2)
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[-.8], 100]];ListPlot[Transpose[{v1, v2}]]KendallTauTest[v1, v2, "TestDataTable"]BlockRandom[
SeedRandom[2];
data1 = RandomVariate[BinormalDistribution[.5], 100];
data2 = RandomVariate[BinormalDistribution[.5], 100];
]0.05水準では,独立性を棄却するためには不十分な証拠しかない:
KendallTauTest[data1, data2, "TestDataTable"]スコープ (8)
検定 (5)
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];{v3, v4} = Transpose[RandomVariate[BinormalDistribution[.7], 100]];KendallTauTest[v1, v2]KendallTauTest[v3, v4]Σ1 = {{12.8, 0.3, 3., -1.5, 5.1}, {0.3, 2.4, 0.9, -0.3, -0.8}, {3., 0.9, 6.5, 0.8, 1.3}, {-1.5, -0.3, 0.8, 1.4, 2.}, {5.1, -0.8, 1.3, 2., 11.1}};data1 = RandomVariate[MultinormalDistribution[{0, 0, 0, 0, 0}, Σ1], 100];KendallTauTest[data1[[All, 1 ;; 2]], data1[[All, 3 ;; 5]]]Σ2 = IdentityMatrix[5];data2 = RandomVariate[MultinormalDistribution[{0, 0, 0, 0, 0}, Σ2], 100];KendallTauTest[data2[[All, 1 ;; 2]], data2[[All, 3 ;; 5]]]繰り返し特性を抽出するためにHypothesisTestDataオブジェクトを作る:
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];ℋ["Properties"]HypothesisTestDataオブジェクトからいくつかの特性を抽出する:
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];ℋ["PValue"]ℋ["TestStatistic"]{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];ℋ["PValue", "TestStatistic"]レポート (3)
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];ℋ["TestDataTable"]レポートをカスタマイズするために検定の表から項目を抽出する:
{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];res = ℋ["TestData"]ℋ["TestDataTable"]Labeled[ProgressIndicator[res[[2]]], Row[{Style["τ: ", Bold, FontSize -> 14], res[[1]]}]]{v1, v2} = Transpose[RandomVariate[BinormalDistribution[0], 100]];ℋ = KendallTauTest[v1, v2, "HypothesisTestData"];ℋ["PValueTable"]ℋ["PValue"]ℋ["TestStatisticTable"]ℋ["TestStatistic"]オプション (9)
AlternativeHypothesis (3)
{v1, v2} = Transpose@RandomVariate[CopulaDistribution[{"Clayton", 1}, {NormalDistribution[], NormalDistribution[]}], 100];KendallTauTest[v1, v2, AlternativeHypothesis -> "Unequal"]KendallTauTest[v1, v2, AlternativeHypothesis -> Automatic]{v1, v2} = Transpose@RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[]}], 100];KendallTauTest[v1, v2, AlternativeHypothesis -> "Unequal"]KendallTauTest[v1, v2, AlternativeHypothesis -> "Less"]KendallTauTest[v1, v2, AlternativeHypothesis -> "Greater"]m = Transpose@RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[], NormalDistribution[], NormalDistribution[]}], 100];KendallTauTest[m[[All, 1 ;; 2]], m[[All, 3 ;; 4]], AlternativeHypothesis -> "Less"]m1 = RandomVariate[BinormalDistribution[0], {250, 50}];
m2 = RandomVariate[BinormalDistribution[0], {250, 50}];t = MapThread[KendallTauTest[#1, #2, "TestStatistic"]&, {m1, m2}];Histogram[t]MaxIterations (1)
data1 = RandomVariate[BinormalDistribution[.5], 25];
data2 = RandomVariate[BinormalDistribution[.5], 25];KendallTauTest[data1, data2, MaxIterations -> 1000]この値を低くしすぎると計算時間は短くなるが,収束に失敗する可能性がある:
KendallTauTest[data1, data2, MaxIterations -> 5]Method (4)
{v1, v2} = Transpose[RandomVariate[CopulaDistribution[{"Clayton", 1}, {NormalDistribution[], NormalDistribution[]}], 100]];KendallTauTest[v1, v2, Method -> Automatic]KendallTauTest[v1, v2, Method -> "Asymptotic"]{v1, v2} = Transpose[RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[]}], 10]];KendallTauTest[v1, v2, Method -> "Permutation"]{v1, v2} = RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[]}], 10]//Transpose;KendallTauTest[v1, v2, Method -> {"Permutation", "MonteCarloSamples" -> 10^4}]KendallTauTest[v1, v2, Method -> {"Permutation", "MonteCarloSamples" -> 10^3}]KendallTauTest[v1, v2, Method -> {"Permutation", "MonteCarloSamples" -> Automatic}]{v1, v2} = RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[]}], 10]//Transpose;KendallTauTest[v1, v2, Method -> {"Permutation", "RandomSeed" -> 0}]KendallTauTest[v1, v2, Method -> {"Permutation", "RandomSeed" -> 9}]SignificanceLevel (1)
有意水準は"TestConclusion"と"ShortTestConclusion"に使われる:
BlockRandom[SeedRandom[3];{v1, v2} = Transpose@RandomVariate[CopulaDistribution[{"Clayton", 3}, {NormalDistribution[], NormalDistribution[]}], 100];];ℋ1 = KendallTauTest[v1, v2, "HypothesisTestData", SignificanceLevel -> .05];ℋ2 = KendallTauTest[v1, v2, "HypothesisTestData", SignificanceLevel -> .000005];ℋ1["TestConclusion"]//TraditionalFormℋ2["TestConclusion"]//TraditionalFormℋ1["ShortTestConclusion"]ℋ2["ShortTestConclusion"]特性と関係 (5)
ベクトル間の比較の際,検定統計量はKendallTauとして計算される:
v1 = RandomVariate[NormalDistribution[], 100];
v2 = RandomVariate[NormalDistribution[], 100];KendallTauTest[v1, v2, "TestStatistic"]KendallTau[v1, v2]行列の比較の際は,検定統計量はChiSquareDistribution[r*s]に従う:
data1 = RandomVariate[BinormalDistribution[0], {250, 50}];
data2 = RandomVariate[BinormalDistribution[0], {250, 50}];t = MapThread[KendallTauTest[#1, #2, "TestStatistic"]&, {data1, data2}];QuantilePlot[t, ChiSquareDistribution[2 * 2]]DistributionFitTest[t, ChiSquareDistribution[2 * 2]]行列の比較の際は,検定統計量はアフィン変換の下で不変である:
m = RandomVariate[MultinormalDistribution[{1, 2, 3, 4}, {{12.8, 0.3, 3., -1.5}, {0.3, 2.4, 0.9, -0.3}, {3., 0.9, 6.5, 0.8}, {-1.5, -0.3, 0.8, 1.4}}], 100];𝒯 = AffineTransform[{{{1, 2}, {3, 4}}, {1, 2}}];KendallTauTest[m[[All, 1 ;; 2]], m[[All, 3 ;; 4]], "TestDataTable"]KendallTauTest[𝒯[m[[All, 1 ;; 2]]], 𝒯[m[[All, 3 ;; 4]]], "TestDataTable"]IndependenceTestを使って独立性の適切な検定を選ぶことができる:
v1 = RandomVariate[NormalDistribution[], 100];
v2 = RandomVariate[NormalDistribution[], 100];IndependenceTest[v1, v2, "TestDataTable"]KendallTauTestは使用できる検定の一つである:
IndependenceTest[v1, v2, {"TestDataTable", "KendallTau"}]KendallTauTestは単調従属しか検出しない:
x = Sort[RandomReal[{-1, 1}, 250]];
y = Tan[x] ^ 3 + RandomReal[{-.25, .25}, 250];
z = Tan[x] ^ 4 + RandomReal[{-.25, .25}, 250];ListPlot[Transpose[#], Frame -> True]& /@ {{x, y}, {x, z}}KendallTauTest[x, y]KendallTauTest[x, z]HoeffdingDTestを使ってより多様な従属構造を検出することができる:
HoeffdingDTest[x, y]HoeffdingDTest[x, z]おもしろい例題 (1)
data1 = RandomVariate[BinormalDistribution[0.], {1500, 100}];T1 = MapThread[KendallTauTest[#1, #2, "TestStatistic"]&, {data1[[All, All, 1]], data1[[All, All, 2]]}];data2 = RandomVariate[BinormalDistribution[0.7], {1500, 100}];T2 = MapThread[KendallTauTest[#1, #2, "TestStatistic"]&, {data2[[All, All, 1]], data2[[All, All, 2]]}];SmoothHistogram[{T1, T2}, Filling -> Axis, PlotLegends -> {"SubscriptBox[H, 0] is True", "SubscriptBox[H, 0] is False"}, PlotStyle -> Thick]関連するガイド
-
▪
- 仮説検定
テキスト
Wolfram Research (2012), KendallTauTest, Wolfram言語関数, https://reference.wolfram.com/language/ref/KendallTauTest.html.
CMS
Wolfram Language. 2012. "KendallTauTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KendallTauTest.html.
APA
Wolfram Language. (2012). KendallTauTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KendallTauTest.html
BibTeX
@misc{reference.wolfram_2026_kendalltautest, author="Wolfram Research", title="{KendallTauTest}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/KendallTauTest.html}", note=[Accessed: 14-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_kendalltautest, organization={Wolfram Research}, title={KendallTauTest}, year={2012}, url={https://reference.wolfram.com/language/ref/KendallTauTest.html}, note=[Accessed: 14-November-2026]}