All-optical calculation of correlations between electrical data