mosaicperm.statistics.mosaic_bcv_stat

mosaicperm.statistics.mosaic_bcv_stat(residuals: array, new_exposure: array, tiles: list, mus: array | None = None) float[source]

Out-of-sample R^2 measuring improvement for an augmented model containing an additional exposure.

Parameters:
residualsnp.array

(n_obs, n_subjects) array of residuals

new_exposurenp.array

n_subject-length array of new exposures

tilesmosaicperm.tilings.Tiling

The Tiling used to produce the mosaic residuals.

musnp.array

Optional n_subjects-length array of estimated means of residuals.

Returns:
r2float

Mosaic bi-cross validation out-of-sample R^2.