PillaiTraceTest
✖
PillaiTraceTest
Details and Options


- PillaiTraceTest performs a hypothesis test on m1 and m2 with null hypothesis
that the matrices are linearly independent, and alternative hypothesis
that they are not.
- By default, a probability value or
-value is returned.
- A small
-value suggests that it is unlikely that
is true.
- The arguments m1 and m2 can be any real-valued vectors or matrices of equal length.
- PillaiTraceTest is based on Pillai's trace statistic computed by PillaiTrace[m1,m2].
- PillaiTraceTest[m1,m2,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
- PillaiTraceTest[m1,m2,"property"] can be used to directly give the value of "property".
- Properties related to the reporting of test results include:
-
"DegreesOfFreedom" the degrees of freedom used in the test "PValue" the -value of the test
"PValueTable" formatted table containing the -value
"ShortTestConclusion" a short description of the conclusion of the test "TestConclusion" a description of the conclusion of the test "TestData" a list containing the test statistic and -value
"TestDataTable" formatted table of the -value and test statistic
"TestStatistic" the test statistic "TestStatisticTable" formatted table containing the test statistic - The following options can be used:
-
Method Automatic the method to use for computing -values
SignificanceLevel 0.05 cutoff for diagnostics and reporting VerifyTestAssumptions Automatic what assumptions to verify - For tests of independence, a cutoff
is chosen such that
is rejected only if
. The value of
used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. This value
is also used in diagnostic tests of normality. By default,
is set to 0.05.
- Named settings for VerifyTestAssumptions in IndependenceTest include:
-
"Normality" verify that all data is normally distributed
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Test whether two vectors are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-g7mcn

https://wolfram.com/xid/0bc6bpmo0mge6o2-deoent


https://wolfram.com/xid/0bc6bpmo0mge6o2-ybn5y

Test whether two matrices are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-2lnxj
At the 0.05 level, there is insufficient evidence to reject independence:

https://wolfram.com/xid/0bc6bpmo0mge6o2-j55r4w

Scope (8)Survey of the scope of standard use cases
Testing (5)
Test whether two vectors are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-mk1rwj

https://wolfram.com/xid/0bc6bpmo0mge6o2-j6h0wh
The -values are typically large when the vectors are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-dcnktx

The -values are typically small when there are dependencies:

https://wolfram.com/xid/0bc6bpmo0mge6o2-b15esj

Test whether two matrices are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-jkearc

https://wolfram.com/xid/0bc6bpmo0mge6o2-cg2xz0
The -values are typically small for dependent matrices:

https://wolfram.com/xid/0bc6bpmo0mge6o2-hr2vr

The -values are typically large when matrices are independent:

https://wolfram.com/xid/0bc6bpmo0mge6o2-hgpbf9

https://wolfram.com/xid/0bc6bpmo0mge6o2-k684ke

https://wolfram.com/xid/0bc6bpmo0mge6o2-cze22

Create a HypothesisTestData object for repeated property extraction:

https://wolfram.com/xid/0bc6bpmo0mge6o2-me44um

https://wolfram.com/xid/0bc6bpmo0mge6o2-cc8eh1
The properties available for extraction:

https://wolfram.com/xid/0bc6bpmo0mge6o2-frvg20

Extract some properties from the HypothesisTestData object:

https://wolfram.com/xid/0bc6bpmo0mge6o2-kv96cm

https://wolfram.com/xid/0bc6bpmo0mge6o2-bpn9dr
The -value and test statistic:

https://wolfram.com/xid/0bc6bpmo0mge6o2-365dq


https://wolfram.com/xid/0bc6bpmo0mge6o2-bn5rjv

Extract any number of properties simultaneously:

https://wolfram.com/xid/0bc6bpmo0mge6o2-nm6fad

https://wolfram.com/xid/0bc6bpmo0mge6o2-dmu6hk
The -value and test statistic:

https://wolfram.com/xid/0bc6bpmo0mge6o2-i6fwj7

Reporting (3)
Tabulate the results from the test:

https://wolfram.com/xid/0bc6bpmo0mge6o2-glp10r

https://wolfram.com/xid/0bc6bpmo0mge6o2-hb1mu5

https://wolfram.com/xid/0bc6bpmo0mge6o2-c83kyd

Retrieve the entries from a test table for customized reporting:

https://wolfram.com/xid/0bc6bpmo0mge6o2-ejmna1

https://wolfram.com/xid/0bc6bpmo0mge6o2-98x7a

https://wolfram.com/xid/0bc6bpmo0mge6o2-fq0ubv


https://wolfram.com/xid/0bc6bpmo0mge6o2-kdpjp6

Tabulate the -value or test statistic:

https://wolfram.com/xid/0bc6bpmo0mge6o2-kvbykx

https://wolfram.com/xid/0bc6bpmo0mge6o2-blo8x

https://wolfram.com/xid/0bc6bpmo0mge6o2-g8i1dt


https://wolfram.com/xid/0bc6bpmo0mge6o2-o0wuj


https://wolfram.com/xid/0bc6bpmo0mge6o2-dt2x9i

The test statistic from the table:

https://wolfram.com/xid/0bc6bpmo0mge6o2-bitsqd

Options (10)Common values & functionality for each option
Method (4)
By default, -values are computed using asymptotic test statistic distributions:

https://wolfram.com/xid/0bc6bpmo0mge6o2-v21sy

https://wolfram.com/xid/0bc6bpmo0mge6o2-fifdab


https://wolfram.com/xid/0bc6bpmo0mge6o2-b9g9ag

The -value can be obtained using permutation methods:

https://wolfram.com/xid/0bc6bpmo0mge6o2-hy6ohx

https://wolfram.com/xid/0bc6bpmo0mge6o2-f69ts

Set the number of permutations to use:

https://wolfram.com/xid/0bc6bpmo0mge6o2-fp5r6k

https://wolfram.com/xid/0bc6bpmo0mge6o2-pbc1ae

By default, random permutations are used:

https://wolfram.com/xid/0bc6bpmo0mge6o2-ktxmmb


https://wolfram.com/xid/0bc6bpmo0mge6o2-eln5k5

Set the seed used for generating random permutations:

https://wolfram.com/xid/0bc6bpmo0mge6o2-cjrea

https://wolfram.com/xid/0bc6bpmo0mge6o2-0du0


https://wolfram.com/xid/0bc6bpmo0mge6o2-f7dru0

SignificanceLevel (2)
Set the significance level for diagnostic tests:

https://wolfram.com/xid/0bc6bpmo0mge6o2-fn2ahc

https://wolfram.com/xid/0bc6bpmo0mge6o2-dwfi1

By default, 0.05 is used. The message shows 0.025 because two tests were performed:

https://wolfram.com/xid/0bc6bpmo0mge6o2-cod4ca


The significance level is also used for "TestConclusion" and "ShortTestConclusion":

https://wolfram.com/xid/0bc6bpmo0mge6o2-bhkod7

https://wolfram.com/xid/0bc6bpmo0mge6o2-lasldz

https://wolfram.com/xid/0bc6bpmo0mge6o2-hykroc

https://wolfram.com/xid/0bc6bpmo0mge6o2-bvt7nt


https://wolfram.com/xid/0bc6bpmo0mge6o2-hpqqgh


https://wolfram.com/xid/0bc6bpmo0mge6o2-flavjg


https://wolfram.com/xid/0bc6bpmo0mge6o2-m2oyg2

VerifyTestAssumptions (4)
By default, normality is tested when appropriate:

https://wolfram.com/xid/0bc6bpmo0mge6o2-hkuna

https://wolfram.com/xid/0bc6bpmo0mge6o2-b9i03c


Diagnostics can be controlled as a group using All or None:

https://wolfram.com/xid/0bc6bpmo0mge6o2-ma0mld

https://wolfram.com/xid/0bc6bpmo0mge6o2-bg3dnp



https://wolfram.com/xid/0bc6bpmo0mge6o2-foxivl

Diagnostics can be controlled independently:

https://wolfram.com/xid/0bc6bpmo0mge6o2-btjvx7

https://wolfram.com/xid/0bc6bpmo0mge6o2-djybum


Explicitly set the diagnostic result:

https://wolfram.com/xid/0bc6bpmo0mge6o2-pwmy4u


https://wolfram.com/xid/0bc6bpmo0mge6o2-n1zvtg


It is often useful to bypass diagnostic tests for simulation purposes:

https://wolfram.com/xid/0bc6bpmo0mge6o2-kfpeh6

https://wolfram.com/xid/0bc6bpmo0mge6o2-cxjgtt

The assumptions of the test hold by design, so a great deal of time can be saved:

https://wolfram.com/xid/0bc6bpmo0mge6o2-cmfh98


https://wolfram.com/xid/0bc6bpmo0mge6o2-btr43n

Properties & Relations (4)Properties of the function, and connections to other functions
PillaiTraceTest uses the PillaiTrace measure as a test statistic:

https://wolfram.com/xid/0bc6bpmo0mge6o2-ceaapp

https://wolfram.com/xid/0bc6bpmo0mge6o2-cx193u

https://wolfram.com/xid/0bc6bpmo0mge6o2-vt2ky


https://wolfram.com/xid/0bc6bpmo0mge6o2-lbvbiu

The -value is computed using a ChiSquareDistribution[r*s]:

https://wolfram.com/xid/0bc6bpmo0mge6o2-cwhbuf

https://wolfram.com/xid/0bc6bpmo0mge6o2-0gyrv


https://wolfram.com/xid/0bc6bpmo0mge6o2-fmbnlv

PillaiTraceTest is one of the tests available to IndependenceTest:

https://wolfram.com/xid/0bc6bpmo0mge6o2-676wj

https://wolfram.com/xid/0bc6bpmo0mge6o2-ci0yyc

IndependenceTest automates the choice of test:

https://wolfram.com/xid/0bc6bpmo0mge6o2-ipfhfw

The Pillai trace test works with the values only when the input is a TimeSeries:

https://wolfram.com/xid/0bc6bpmo0mge6o2-7py5sj

https://wolfram.com/xid/0bc6bpmo0mge6o2-0467fg

https://wolfram.com/xid/0bc6bpmo0mge6o2-57bf57


https://wolfram.com/xid/0bc6bpmo0mge6o2-vvd88

The Pillai trace test works with all the values together when the input is a TemporalData:

https://wolfram.com/xid/0bc6bpmo0mge6o2-qry3ls

https://wolfram.com/xid/0bc6bpmo0mge6o2-b1l4g0


Test selected components of the temporal data explicitly:

https://wolfram.com/xid/0bc6bpmo0mge6o2-zzfutb


https://wolfram.com/xid/0bc6bpmo0mge6o2-7pj41y


https://wolfram.com/xid/0bc6bpmo0mge6o2-kxzwhd

https://wolfram.com/xid/0bc6bpmo0mge6o2-jdvl55

Neat Examples (1)Surprising or curious use cases
Compute the statistic when the null hypothesis is true:

https://wolfram.com/xid/0bc6bpmo0mge6o2-2qqg3c

https://wolfram.com/xid/0bc6bpmo0mge6o2-ywy3ty
The test statistic given a particular alternative:

https://wolfram.com/xid/0bc6bpmo0mge6o2-frkcev

https://wolfram.com/xid/0bc6bpmo0mge6o2-c5cy2n
Compare the distributions of the test statistics:

https://wolfram.com/xid/0bc6bpmo0mge6o2-87eb6q

Wolfram Research (2012), PillaiTraceTest, Wolfram Language function, https://reference.wolfram.com/language/ref/PillaiTraceTest.html.
Text
Wolfram Research (2012), PillaiTraceTest, Wolfram Language function, https://reference.wolfram.com/language/ref/PillaiTraceTest.html.
Wolfram Research (2012), PillaiTraceTest, Wolfram Language function, https://reference.wolfram.com/language/ref/PillaiTraceTest.html.
CMS
Wolfram Language. 2012. "PillaiTraceTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PillaiTraceTest.html.
Wolfram Language. 2012. "PillaiTraceTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PillaiTraceTest.html.
APA
Wolfram Language. (2012). PillaiTraceTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PillaiTraceTest.html
Wolfram Language. (2012). PillaiTraceTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PillaiTraceTest.html
BibTeX
@misc{reference.wolfram_2025_pillaitracetest, author="Wolfram Research", title="{PillaiTraceTest}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/PillaiTraceTest.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_pillaitracetest, organization={Wolfram Research}, title={PillaiTraceTest}, year={2012}, url={https://reference.wolfram.com/language/ref/PillaiTraceTest.html}, note=[Accessed: 29-March-2025
]}