smoother_resid {edecob}R Documentation

Residuals of the Smoother

Description

Calculate the residuals of the smoother to the data points.

Usage

smoother_resid(data, smoother_pts)

Arguments

data

A data frame in long format containing the data for which events is to be detected. This means that each measurement corresponds to a row and the columns are (in order): source (the device or person from which the data was collected), point in time, and measurement value. If custom detection bounds are chosen, the folloing two columns must be added: lower detection bound, and upper detection bound.

The source is expected to be a string; the time point are integers; measurements, and detection bounds are expected to be numerical. The detection bounds are in absolute value in the same unit as the values and each is expected to be identical for the same source.

In case detection is wanted for a one sided change (e.g. give an event if the confidence bounds drop below a threshold) then the upper or lower detection bound can be chosen to be Inf or -Inf respectively.

smoother_pts

A data frame containing the smoother. Preferably the output of one of the smoother functions included in this package.

Value

A vector of the same length as data containing the residuals.


[Package edecob version 1.2.2 Index]