RRR_sim {RRRR}R Documentation

Simulating data for Reduced-Rank Regression

Description

Simulate data for Reduced-rank regression. See Detail for the formulation of the simulated data.

Usage

RRR_sim(
  N = 1000,
  P = 3,
  Q = 3,
  R = 1,
  r = 1,
  mu = rep(0.1, P),
  A = matrix(rnorm(P * r), ncol = r),
  B = matrix(rnorm(Q * r), ncol = r),
  D = matrix(rnorm(P * R), ncol = R),
  varcov = diag(P),
  innov = mvtnorm::rmvt(N, sigma = varcov, df = 3),
  mean_x = 0,
  mean_z = 0,
  x = NULL,
  z = NULL
)

Arguments

N

Integer. The total number of simulated realizations.

P

Integer. The dimension of the response variable matrix. See Detail.

Q

Integer. The dimension of the explanatory variable matrix to be projected. See Detail.

R

Integer. The dimension of the explanatory variable matrix not to be projected. See Detail.

r

Integer. The rank of the reduced rank coefficient matrix. See Detail.

mu

Vector with length P. The constants. Can be NULL to drop the term. See Detail.

A

Matrix with dimension P*r. The exposure matrix. See Detail.

B

Matrix with dimension Q*r. The factor matrix. See Detail.

D

Matrix with dimension P*R. The coefficient matrix for z. Can be NULL to drop the term. See Detail.

varcov

Matrix with dimension P*P. The covariance matrix of the innovation. See Detail.

innov

Matrix with dimension N*P. The innovations. Default to be simulated from a Student t distribution, See Detail.

mean_x

Integer. The mean of the normal distribution xx is simulated from.

mean_z

Integer. The mean of the normal distribution zz is simulated from.

x

Matrix with dimension N*Q. Can be used to specify xx instead of simulating form a normal distribution.

z

Matrix with dimension N*R. Can be used to specify zz instead of simulating form a normal distribution.

Details

The data simulated can be used for the standard reduced-rank regression testing with the following formulation

y=μ+ABx+Dz+innov,y = \mu +AB' x + D z+innov,

where for each realization yy is a vector of dimension PP for the PP response variables, xx is a vector of dimension QQ for the QQ explanatory variables that will be projected to reduce the rank, zz is a vector of dimension RR for the RR explanatory variables that will not be projected, μ\mu is the constant vector of dimension PP, innovinnov is the innovation vector of dimension PP, DD is a coefficient matrix for zz with dimension PRP*R, AA is the so called exposure matrix with dimension PrP*r, and BB is the so called factor matrix with dimension QrQ*r. The matrix resulted from ABAB' will be a reduced rank coefficient matrix with rank of rr. The function simulates xx, zz from multivariate normal distribution and yy by specifying parameters μ\mu, AA, BB, DD, and varcovvarcov, the covariance matrix of the innovation's distribution. The constant μ\mu and the term DzDz can be dropped by setting NULL for arguments mu and D. The innov in the argument is the collection of innovations of all the realizations.

Value

A list of the input specifications and the data yy, xx, and zz, of class RRR_data.

y

Matrix of dimension N*P

x

Matrix of dimension N*Q

z

Matrix of dimension N*R

Author(s)

Yangzhuoran Yang

Examples

set.seed(2222)
data <- RRR_sim()


[Package RRRR version 1.1.1 Index]