1 uint[] stock1Price = [8, 6, 7, 5, 3, 0, 9]; 2 uint[] stock2Price = [3, 1, 4, 1, 5, 9, 2]; 3 uint[] economicHealth = [2, 7, 1, 8, 2, 8, 1]; 4 uint[] consumerFear = [1, 2, 3, 4, 5, 6, 7]; 5 6 // See whether the prices of stock 1 and stock 2 are correlated even 7 // after adjusting for the overall condition of the economy and consumer 8 // fear. 9 double partialCor = 10 partial!pearsonCor(stock1Price, stock2Price, economicHealth, consumerFear);
Computes the partial correlation between vec1, vec2 given conditions. conditions can be either a tuple of ranges, a range of ranges, or (for a single condition) a single range.
cor is the correlation metric to use. It can be either pearsonCor, spearmanCor, kendallCor, or any custom correlation metric you can come up with.