spe.estimators.cp_smoother#

spe.estimators.cp_smoother(model, X, y, tr_idx, Chol_y=None, Chol_ystar=None, Cov_y_ystar=None)#

Computes Generalized Mallows’s Cp for any linear model and dependent train and test set.

Parameters:
model: object
Xarray-like of shape (n_samples, n_features)
yarray-like of shape (n_samples,)
tr_idxbool array-like of shape (n_samples,)

Boolean index of which samples to train the model on.

Chol_yarray-like of shape (n_samples, n_samples), optional

Cholesky of covariance matrix of \(\Sigma_Y\). Default is None in which case Chol_y is set to np.eye(n).

Chol_ystararray-like of shape (n_samples, n_samples), optional

Cholesky of covariance matrix of \(\Sigma_{Y^*}\). Default is None in which case Chol_ystar is set to np.eye(n).

Cov_y_ystararray-like of shape (n_samples, n_samples), optional

Covariance matrix of \(\Sigma_{Y,Y^*}\). Default is None in which case it is assumed \(\Sigma_{Y,Y^*} = 0\).

Returns:
err_estfloat

Cp type estimate of MSE.