quantlab.model.evaluation.cross_sectional_ic#
- quantlab.model.evaluation.cross_sectional_ic(pred, target)[source]#
Return the mean over time of the per-row Pearson correlation.
The mean runs over the rows
cross_sectional_ic_seriesdoes not skip (see there for when a row is skipped). NaN is returned when every row is skipped.- Parameters:
- predarray_like
A 2-D
[T, S]panel of predictions.- targetarray_like
A 2-D
[T, S]panel of realised values.
- Raises:
- ValueError
If the inputs are not 2-D or differ in shape.
Examples
>>> pred = np.array([[3.0, 1.0, 2.0], [1.0, 3.0, 2.0]]) >>> target = np.array([[9.0, 1.0, 4.0], [1.0, 9.0, 4.0]]) >>> cross_sectional_ic(pred, target) 0.989743318610787