ResidualCorrelation

Estimated residual correlation structure.

Usage

Source

ResidualCorrelation(
    covariance,
    correlation,
    responses,
)

Returned by MultiResponseGAM.residual_correlation() when the model was fit with correlation="unstructured". Holds the empirical residual covariance and correlation matrices across the k jointly modeled responses, estimated from each response’s fitted-model residuals.

Attributes

covariance: NDArray

Residual covariance matrix (k x k) where k = number of responses, computed as R'R / (n - 1) where R is the (n, k) matrix of residuals (observed minus fitted, one column per response).

correlation: NDArray

Residual correlation matrix (k x k), the covariance matrix rescaled to unit diagonal.

responses: list[str]
Response names (ordering matches matrix rows/columns).