public static IEnumerable <TemporalGapTuple> DoCorrelationAnalysis( TimeSeries ts1, TimeSeries ts2, CorrelationAnalysisParameters parameters) { return(parameters.GetTimeSpans() .Select(span => new TemporalGapTuple { Indicator = ts1, Target = ts2, TemporalGap = -span, Correlation = GetCorrelationBetween(ts1, ts2.OffsetBy(span)) })); }