falling_limb: classify the falling limb of chlorine trend

View source: R/falling-limb.R

falling_limbR Documentation

classify the falling limb of chlorine trend

Description

falling_limb use the first and second derivative of a time series slope to classify portions of it as the falling limb of the curve

Usage

falling_limb(
  data,
  method = c("simple", "hmm", "cp"),
  value_col,
  first_deriv,
  group_col
)

Arguments

data

a data frame with chlorine residual results

method

the method used to classify the falling limb of the chlorine curve. See Details.

value_col

unqouted column name of column containing the chlorine results for the time series

first_deriv

unquoted column name of column containing first derivative of chlorine time series

group_col

vector of unqouted column names of any grouping columns

Details

the method argument must be set to one of the following:

  • "simple" - A simple classification method that classifies any negative first derivative value as a part of the falling limb. Taking the first derivative of the moving average of the chlorine values is likely to reduce false classification rates when this model type is selected

  • "hmm" - This method uses the depmixS4 package to fit a hidden markov model using the time trend of the first derivative of the total chlorine trend

  • "cp" - This method uses the strucchange package to identify change points in the first derivative trned and classify values based on median first derivative values between changepoints


tbradley1013/dwqr documentation built on Feb. 11, 2024, 10:03 a.m.