This function generates the matrices \(M\) and \(U\) with envelope structure.
MenvU_sim(
p,
u,
Omega = NULL,
Omega0 = NULL,
Phi = NULL,
jitter = FALSE,
wishart = FALSE,
n = NULL
)
Dimension of \(p\)-by-\(p\) matrix \(M\).
The envelope dimension. An integer between 0 and \(p\).
The positive definite matrix \(\Omega\) in \(M=\Gamma\Omega\Gamma^T+\Gamma_0\Omega_0\Gamma_0^T\). The default is \(\Omega=AA^T\) where the elements in \(A\) are generated from Uniform(0,1) distribution.
The positive definite matrix \(\Omega_0\) in \(M=\Gamma\Omega\Gamma^T+\Gamma_0\Omega_0\Gamma_0^T\). The default is \(\Omega_0=AA^T\) where the elements in \(A\) are generated from Uniform(0,1) distribution.
The positive definite matrix \(\Phi\) in \(U=\Gamma\Phi\Gamma^T\). The default is \(\Phi=AA^T\) where the elements in \(A\) are generated from Uniform(0,1) distribution.
Logical or numeric. If it is numeric, the diagonal matrix diag(jitter, nrow(M), ncol(M))
is added to matrix \(M\) to ensure the positive definiteness of \(M\). If it is TRUE
, then it is set as 1e-5
and the jitter is added. If it is FALSE
(default), no jitter is added.
Logical. If it is TRUE
, the sample estimator from Wishart distribution \(W_p(M/n, n)\) and \(W_p(U/n, n)\) are generated as the output matrices M
and U
.
The sample size. If wishart
is FALSE
, then n
is ignored.
The \(p\)-by-\(p\) matrix M
.
The \(p\)-by-\(p\) matrix U
.
The \(p\)-by-\(u\) envelope basis.
The matrices \(M\) and \(U\) are in forms of $$M = \Gamma \Omega \Gamma^T + \Gamma_0\Omega_0\Gamma_0^T, U = \Gamma \Phi \Gamma^T.$$
The envelope basis \(\Gamma\) is randomly generated from the Uniform (0, 1) distribution elementwise and then transformed to a semi-orthogonal matrix. \(\Gamma_0\) is the orthogonal completion of \(\Gamma\).
In some cases, to guarantee that \(M\) is positive definite which is required by the definition of envelope, a jitter
should be added to \(M\).
If wishart
is TRUE
, after the matrices \(M\) and \(U\) are generated, the samples from Wishart distribution \(W_p(M/n, n)\) and \(W_p(U/n, n)\) are output as matrices \(M\) and \(U\). If so, n
is required.
Cook, R.D. and Zhang, X., 2018. Fast envelope algorithms. Statistica Sinica, 28(3), pp.1179-1197.
# NOT RUN {
data1 <- MenvU_sim(p = 20, u = 5)
M1 <- data1$M
U1 <- data1$U
# Sample version from Wishart distribution
data2 <- MenvU_sim(p = 20, u = 5, wishart = TRUE, n = 200)
M2 <- data2$M
U2 <- data2$U
# }
Run the code above in your browser using DataLab