Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
cts.covarianceP( $value1 as cts.reference, $value2 as cts.reference, [$options as String[]], [$query as cts.query?], [$forest-ids as String[]] ) as Number?
Returns the frequency-weighted covariance of the population given a 2-way
co-occurrence. The co-occurence is formed from the specified value lexicons.
This function works like
math.covarianceP
except each pair
in the co-occurrence is counted
cts.frequency
times. This
function performs the calculation in parallel in all data nodes then
aggregates the values.
// This query assumes range indexes with positions are // configured in the database for both xval and yval. It // generates some sample data and then performs the // aggregation in a separate transaction. // Generate data: declareUpdate(); for (x=1; x<11; x++) { const j = 2 * x; const o = new Object(); o.xval = x; o.yval = []; for (y=0; y<x; y++) { o.yval.push(j); }; xdmp.documentInsert(("cov" + x + ".json"), o); }; ******* // Run the query: cts.covarianceP( cts.jsonPropertyReference("xval","type=int"), cts.jsonPropertyReference("yval","type=int"), ["item-frequency"]); => 12
Comments