StdDevOverTime

This function returns the standard deviation of all values whose timestamps are greater than the newest timestamp minus the specified interval.

Syntax

StdDevOverTime ( number, valueTimestamp, interval)

Remarks

The number parameter specifies the data value for which the standard deviation is to be calculated. The valueTimestamp is the timestamp for this data value. (The Timestamp function can be used to obtain this timestamp.) function can be used to obtain this timestamp.) The interval parameter is the time interval, in nanoseconds, over which to calculate the standard deviation. The predefined time constants can be used to easily input the number of nanoseconds in a microsecond (nsecPerUSec), millisecond (nsecPerMSec), second (nsecPerSec), minute (nsecPerMin), hour (nsecPerHour), day (nsecPerDay), or week (nsecPerWeek). The function will buffer any values whose time is within the specified interval. Any value that evaluates to –INF, INF, or NAN will be ignored. If there are no valid values stored, this function will return NAN.

 The following equation is used to calculate the StdDev:

where σ(x) is the standard deviation of x, and N is the number of samples.

Example

The following example will return the standard deviation of the variable Temp_F over the past 24 hours. (The StartRelativeToNewest function backfills the data set initially to the full 24 hour interval, provided that the data is available in the data source.)

StartRelativeToNewest(24*nsecPerHour, OrderCollected); StdDevOverTime("Server:CR1000.Hourly.Temp_F",TimeStamp("Server:CR1000.Hourly.Temp_F"), 24*nsecPerHour)