quantlab.model.evaluation.mse#

quantlab.model.evaluation.mse(pred, target)[source]#

Return the mean squared error over the jointly finite cells, or NaN if none.

Parameters:
predarray_like

Predictions, any shape.

targetarray_like

Realised values, the same shape as pred.

Examples

>>> mse([1.0, 2.0, 3.0, 4.0], [1.0, 2.0, 3.0, 6.0])
1.0
>>> mse([1.0, np.nan], [np.nan, 2.0])
nan