Rate And Weighted Analytics

Generic Description

Is a live Cypher function in Nexyron. It is documented separately because time construction, sequence ordering, window parameters, and as-of behavior materially change analytical meaning.

Simple example:

RETURN rate([{ts: 1000, value: 10}, {ts: 2000, value: 20}, {ts: 3000, value: 30}])

Consumer-Level Explanation

Use it when the function semantics match the query intent exactly. Prefer this function when the temporal assumption should be visible to the planner, especially for event streams, freshness checks, and sequence features.

More Detailed Explanation

Rate And Weighted Analytics should be understood by the value shape it expects and the row shape it returns. It composes with MATCH, WHERE, WITH, RETURN, and procedure output, so planner-facing documentation should describe both the immediate value transformation and why it belongs in the database query.

Advanced Example

This example names the event stream and operational context before applying Rate And Weighted Analytics, which helps planner tooling preserve the intended sequence semantics.

CALL nexyron.temporal_history(42, 'heart_rate', 0, 3600000)
YIELD ts, value
WITH collect({ts: ts, value: value}) AS bpm_series
RETURN derivative(bpm_series, 'value') AS per_step_rate,
       irate(bpm_series, 'value') AS latest_rate,
       time_weighted_avg(bpm_series, 'value') AS tw_avg_bpm,
       time_weighted_sum(bpm_series, 'value') AS tw_integral

Real Use Cases

Real Limitations And Tradeoffs