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:

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:

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 NULL, which sets it to (1:min(15, min(dim(X), dim(Y)))).

lambda

A numeric vector of ridge penalty values. Default value is 1.

component

Logical indicating if Bhat is returned as vectors or matrices. If TRUE, returns Bhat as component vectors. If FALSE, returns Bhat as matrices.

center.X

Logical indicating if X should be centered. If TRUE, scales X. Default is TRUE.

center.Y

Logical indicating if Y should be centered. If TRUE, scales Y. Default is TRUE.

scale.X

Logical indicating if X should be scaled. If TRUE, scales X. Default is FALSE.

scale.Y

Logical indicating if Y should be scaled. If TRUE, scales Y. Default is FALSE.

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)

[Package rrda version 0.1.1 Index]