rrda.fit {rrda} | R Documentation |
Calculate the coefficient Bhat by Ridge Redundancy Analysis.
Description
This function performs Ridge Redundancy Analysis (RRDA) to obtain the coefficient Bhat, which models the relationship between a matrix of response variables (Y; n \times q
matrix) and a matrix of explanatory variables (X; n \times p
matrix). Especially, the function is designed to facilitate a high-dimensional computation and storing (for the details, refer to the article Yoshioka et al. 2025).
The Ridge Redundancy Analysis model is represented as:
Y = XB + E
where:
-
Y
is the response matrix (n \times q
), -
X
is the predictor matrix (n \times p
), -
B
is the regression coefficient matrix (p \times q
), and -
E
is the error matrix (n \times q
).
The regularized estimate of B
is described as:
\hat{B}(\lambda) = \left(X'X + \lambda P_{X'}\right)^{-} X'Y
Additionally, the regularized-rank-restricted estimation of B
is represented as:
\hat{B}(\lambda, r) = U_{\hat{B}(\lambda)}^{[r]} D_{\hat{B}(\lambda)}^{[r]} V_{\hat{B}(\lambda)}^{[r]'}
Here:
-
U_{\hat{B}(\lambda)}^{[r]}
is ap \times r
matrix, -
D_{\hat{B}(\lambda)}^{[r]}
is ar \times r
diagonal matrix, and -
V_{\hat{B}(\lambda)}^{[r]}
is aq \times r
matrix.
The user can specify ranks (nrank), ridge penalty values (lambda), and whether to center and scale the X and Y matrices.
The Bhat can be returned as either component vectors or matrices. To store a large size of matrix, the coefficient Bhat is by default stored as LeftBhatlambda_k (F; p \times r
matrix) and RightBhatlambda_k (G; q \times r
). Here, r is the specified rank (nrank) in the Ridge Redundancy Analysis formula.
For i = 1, \ldots, r
, the matrices F
and G
are defined as:
F_{.i} = U_{\hat{B}(\lambda)}^{[i]}D_{\hat{B}(\lambda)}^{[i]}, \quad G_{.i} = V_{\hat{B}(\lambda)}^{[i]}
These definitions allow the decomposition of \hat{B}(\lambda)
into rank-specific components, facilitating the storing of the high-dimensional regression coefficients. To reconstruct the matrix form of Bhat, you can use the rrda.coef
function.
Usage
rrda.fit(
Y,
X,
nrank = NULL,
lambda = 1,
component = TRUE,
center.X = TRUE,
center.Y = TRUE,
scale.X = FALSE,
scale.Y = FALSE
)
Arguments
Y |
A numeric matrix of response variables. |
X |
A numeric matrix of explanatory variables. |
nrank |
A numeric vector specifying the ranks of Bhat. Default is |
lambda |
A numeric vector of ridge penalty values. Default value is 1. |
component |
Logical indicating if Bhat is returned as vectors or matrices. If |
center.X |
Logical indicating if |
center.Y |
Logical indicating if |
scale.X |
Logical indicating if |
scale.Y |
Logical indicating if |
Value
A list containing Bhat components or Bhat matrices (the coefficient of Ridge Redundancy Analysis for each parameter lambda and nrank), ranks, and lambda values.
Examples
set.seed(10)
simdata<-rdasim1(n = 100,p = 200,q = 200,k = 5)
X <- simdata$X
Y <- simdata$Y
# Sequential
Bhat <- rrda.fit(Y = Y, X = X, nrank = c(1:10))
names(Bhat)