MenvU_sim {TRES}R Documentation

Generate matrices MM and UU

Description

This function generates the matrices MM and UU with envelope structure.

Usage

MenvU_sim(
  p,
  u,
  Omega = NULL,
  Omega0 = NULL,
  Phi = NULL,
  jitter = FALSE,
  wishart = FALSE,
  n = NULL
)

Arguments

p

Dimension of pp-by-pp matrix MM.

u

The envelope dimension. An integer between 0 and pp.

Omega

The positive definite matrix Ω\Omega in M=ΓΩΓT+Γ0Ω0Γ0TM=\Gamma\Omega\Gamma^T+\Gamma_0\Omega_0\Gamma_0^T. The default is Ω=AAT\Omega=AA^T where the elements in AA are generated from Uniform(0,1) distribution.

Omega0

The positive definite matrix Ω0\Omega_0 in M=ΓΩΓT+Γ0Ω0Γ0TM=\Gamma\Omega\Gamma^T+\Gamma_0\Omega_0\Gamma_0^T. The default is Ω0=AAT\Omega_0=AA^T where the elements in AA are generated from Uniform(0,1) distribution.

Phi

The positive definite matrix Φ\Phi in U=ΓΦΓTU=\Gamma\Phi\Gamma^T. The default is Φ=AAT\Phi=AA^T where the elements in AA are generated from Uniform(0,1) distribution.

jitter

Logical or numeric. If it is numeric, the diagonal matrix diag(jitter, nrow(M), ncol(M)) is added to matrix MM to ensure the positive definiteness of MM. 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.

wishart

Logical. If it is TRUE, the sample estimator from Wishart distribution Wp(M/n,n)W_p(M/n, n) and Wp(U/n,n)W_p(U/n, n) are generated as the output matrices M and U.

n

The sample size. If wishart is FALSE, then n is ignored.

Details

The matrices MM and UU are in forms of

M=ΓΩΓT+Γ0Ω0Γ0T,U=ΓΦΓT.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. Γ0\Gamma_0 is the orthogonal completion of Γ\Gamma.

In some cases, to guarantee that MM is positive definite which is required by the definition of envelope, a jitter should be added to MM.

If wishart is TRUE, after the matrices MM and UU are generated, the samples from Wishart distribution Wp(M/n,n)W_p(M/n, n) and Wp(U/n,n)W_p(U/n, n) are output as matrices MM and UU. If so, n is required.

Value

M

The pp-by-pp matrix M.

U

The pp-by-pp matrix U.

Gamma

The pp-by-uu envelope basis.

References

Cook, R.D. and Zhang, X., 2018. Fast envelope algorithms. Statistica Sinica, 28(3), pp.1179-1197.

Examples

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


[Package TRES version 1.1.5 Index]