normalize: Normalize Time Series

Description Usage Arguments Value Warning See Also

View source: R/normalize.R

Description

normalize normalizes the time series to a specified baseline reference period using (ts-baseline)/baseline where ts is the time series and baseline is the mean of the values belonging to the baseline period. If the baseline period is too unstable (usually an indication that get_artifacts failed to detect an artifact during the baseline period and that its tuning parameters should be adjusted), a warning will be issued and normalization will not be performed. (A vector of NAs will be returned.)

Usage

1
normalize(ts, baseline)

Arguments

ts

A time series, passed as a vector of chronologically ordered observations separated by equal intervals of time.

baseline

A logical vector indicating which elements of the time series correspond to the baseline period.

Value

A baseline-normalized copy of the time series converted to units of relative change (difference from baseline as a fraction of baseline).

Warning

Interpolation of missing values should be done prior to running this function. Time series with any NAs will be silently rejected by returning a vector consisting entirely of NAs.

See Also

artifacts, low_pass_filter


jashu/itrak documentation built on May 9, 2020, 1:57 p.m.