
Calculate the predicted matrix Yhat using the coefficient Bhat obtained from the rrda.fit function.
rrda.predict.RdThis function calculates the predicted response matrix (Yhat) using Bhat (the coefficient of Ridge Redundancy Analysis) obtained from the rrda.fit function. The user can specify the ranks and lambda values to be used for the prediction. If not provided, the ranks and lambda values are set based on the Bhat components. The function returns the predicted Yhat matrix, as well as the ranks and lambda values used.
The predicted response matrix is calculated as: $$\hat{Y}_r = X \left( \sum_{i=1}^{r} (F_{.i} G_{.i}^{\prime}) \right) = \sum_{i=1}^{r} (X F_{.i} G_{.i}^{\prime}) = \sum_{i=1}^{r} (\tilde{X}_{.i} G_{.i}^{\prime})$$
Here, \(\tilde{X} = X F\), and \(r\) is the rank of \(\hat{B}(\lambda, r)\).
The regularized-rank-restricted estimation of \(B\) is obtained from the rrda.fit function:
$$\hat{B}(\lambda, r) = FG^{\prime}$$
Arguments
- Bhat
A list of vectors of Bhat components, obtained by the
rrda.fitfunction.- X
A numeric matrix of explanatory variables.
- 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.