% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/large.eig.test.R
\name{large.eig.power.dat}
\alias{large.eig.power.dat}
\title{Empirical power of the test based on the largest eigenvalue of the sample core with the given data}
\usage{
large.eig.power.dat(dat, center = TRUE, samp.num = 1000, iter = 10)
}
\arguments{
\item{dat}{the \eqn{n \times p1 \times p2} data tensor (sample x row x column).}

\item{center}{logical, whether to center the data or not; TRUE by default.}

\item{samp.num}{the number of iterations for simulating the transformed null test statistic; 1000 by default.}

\item{iter}{the unit number at which to print the number of current iterations; 10 by default.}
}
\value{
\code{large.eig.power.dat} returns a list with the following elements:
\describe{
\item{test.stat}{the computed test statistic based on \code{dat} after some transformation;}
\item{null.stat}{the vector of \code{samp.num} Monte-Carlo simulated null test statistics after some transformation;}
\item{para.pval}{the p-value evaluated based on Monte-Carlo approximated empirical null distribution (\code{null.stat});}
\item{nonpara.pval}{the p-value evaluated by comparing the test statistic to the Tracy-Widom law.}
}
}
\description{
Evaluate the empirical power of the test based on \eqn{\lambda_1 (\hat{C})} with the tensor data, \eqn{Y \in \mathbb{R}^{n \times p_1 \times p_2}}.
The power is evaluated with the transformed \eqn{\lambda_1 (\hat{C})} so that it may follow the Tracy-Widom law under the null and some local alternative regimes (see Theorem 2 of Sung and Hoff (2025)).
The parametric p-value (\code{para.pval}) is evaluated for each test statistic by comparing it to the Monte-Carlo approximated null distribution (\code{null.stat}).
On the other hand, the nonparametric p-value (\code{nonpara.pval}) is evaluated for each test statistic by comparing it to the Tracy-Widom law.
For details, see Section 5.2 of Sung and Hoff (2025). If the mean is assumed to be known, you may not center the data (\code{center=FALSE}). Otherwise, you should center the data (\code{center=TRUE}).
}
\examples{
p1=10; p2=12; r=4; n=150
p=p1*p2

set.seed(100)
para.list=pi.rank_r.core(p1,p2,r,lambda.gen=FALSE)

# local alternative
Sigma=pi.core(para.list,lambda0=0.8)
Sigma.root=sym.root(Sigma)
dat=crossprod(Sigma.root,matrix(rnorm(n*p),ncol=n))
dat=array(dat,dim=c(p1,p2,n))
dat=aperm(dat,perm=c(3,1,2))
large.eig.power.dat(dat,center=FALSE,samp.num=20)

}
\references{
Sung, B. and Hoff, P. (2025). Testing Separability of High-Dimensional Covariance Matrices.
arXiv preprint arXiv:2506.17463.
}
\author{
Bongjung Sung
}
