Temporal.Calculus.rateOfChangeDouble()

Signature

double rateOfChangeDouble(PropertyAtomDouble pad, long stime, long etime, int sample_rate, boolean bound_by_stime)

Domain

ACTION, CONDITION, QUERY, BUI

Description

This method performs a least-squares fit of a straight line (Y = mX +b) and returns the value of the slope of the line (m) as the rate of change of the given PorpertyAtomInt over the time interval[stime, etime]. All the times are in (milliseconds).

Parameters

NameTypeDescription
padPropertyAtomDoubleThe property to calculate the rate of change for.
stimelongstart time of the interval, 0 means use oldest value's timestamp as start time.
etimelongend time of the interval, 0 means use newest value's timestamp as end time.
sample_rateintsample rate for the interval should be greater than 0.
bound_by_stimebooleantrue implies for stime less than oldest value's time stamp[t0] use t0.

Returns

TypeDescription
doublereturns the identified value.

Cautions

If value did not exist through the entire interval an exception is thrown.