% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sep.exp.test.R
\name{sep.exp.power.dat}
\alias{sep.exp.power.dat}
\title{Empirical power of the test based on the separable expansion of the sample core with the given data}
\usage{
sep.exp.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{sep.exp.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});}
}
}
\description{
Evaluate the empirical power of the test based on the separable expansion of the sample core \eqn{\hat{ C }} with the tensor data, \eqn{Y \in \mathbb{R}^{n \times p_1 \times p_2}}.
The test statistic is given by \eqn{T(Y) = || \hat{C} ||_F^2/p-1}. The power is evaluated with respect to \eqn{nT(Y)-p-1}.
Given a level \eqn{\alpha \in (0,1)} (specified in \code{alpha}), the parametric power is evaluated. To this end, the p-value (\code{para.pval}) is first evaluated for each test statistic by comparing it to the Monte-Carlo approximated null distribution (\code{null.stat}).
Then the power (\code{para.power}) is evaluated as the proportion of these p-values smaller than \eqn{\alpha}. 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=100
p=p1*p2

set.seed(100)
para.list=pi.rank_r.core(p1,p2,r,lambda.gen=FALSE)
Sigma=pi.core(para.list,lambda0=0.99)
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))
sep.exp.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
}
