
Calculate the Bhat matrix from the return of the rrda.fit function.
rrda.coef.RdThis function calculates the coefficient Bhat (the coefficient of Ridge Redundancy Analysis for each parameter lambda and nrank) as a matrix form by using the Bhat components calculated by the rrda.fit function. This function obtain the matrix form of Bhat as follows $$\hat{B}(\lambda, r) = FG^{\prime}$$
Here, the Bhat components F and G are obtained from the rrda.fit function as follows
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]}$$
If the input already contains Bhat as matrix form (Bhat_mat), the function selects the preferred matrix from the list of Bhat matrices.
The function can handle different ranks (nrank) and ridge penalty values (lambda) based on the input. If nrank or lambda is NULL, the function will use the values from the Bhat components. Note that if lambda = NULL and B matrix is large (nrow(B)*ncol(B) > 100000), the function is performed for the minimum lambda value only.
Arguments
- Bhat
A list of vectors of Bhat components, obtained by the
rrda.fitfunction. If Bhat_mat is detected in Input, it selects the preferred matrix from the list of Bhat.- nrank
A numeric vector specifying the ranks of Bhat. Default is
NULL, which sets it to the ranks defined in the Bhat components.- lambda
A numeric vector of ridge penalty values. Default is
NULL, which sets it to the lambda values defined in the Bhat components.