Collapse and Correlation Methods in C#

These methods summarize one or two sequences into a single-value result represented by a Sequence.

In the C# API, analytics operate on Sequence values obtained from OrderedSequence<T> searches, direct ordered-sequence iteration, UnorderedSequence<T>.All, or positional projections such as quote.Close[dayRange].

For an overview see page The C# Sequence Class

Operations

source.Wsum(weights)
Calculates the weighted sum of the source sequence.
source.Wavg(weights)
Calculates the weighted average of the source sequence.
Sequence.Cov(left, right)
Returns the covariance between two sequences.
Sequence.Corr(left, right)
Returns the correlation between two sequences.

Example

The seqapi sample uses Sequence.Corr to measure the correlation between low and high prices.

    using (Sequence corr = Sequence.Corr(quote.Low, quote.High))
    {
        PrintFloatSequence(quote, corr);
    }