Skip to contents

[Deprecated]

This function was deprecated, please use detect_peak_points().

Usage

fc_detect_peak_points(
  data_source,
  sel_method = c("trend_linear", "trend_non_linear", "threshold", "GAM_deriv", "SNI"),
  sd_threshold = 2
)

Arguments

data_source

tibble. Output of estimate_roc().

sel_method

character. Method to use for peak-point detection.

  • "threshold" - Each point is compared to the median of all RoC scores. A point is significant if its 95th-quantile RoC exceeds the median threshold.

  • "trend_linear" - A linear model is fitted between RoC values and their ages. A peak is significant if it is sd_threshold SD above the fitted value.

  • "trend_non_linear" - A conservative GAM (RoC ~ s(age, k = 3)) is fitted. A peak is significant if it is sd_threshold SD above the fitted value.

  • "GAM_deriv" - A smooth GAM (RoC ~ s(age)) is fitted and the first derivative evaluated using the gratia package (Simpson, 2018). A peak is significant if the confidence interval of the first derivative excludes zero.

  • "SNI" - Signal-to-noise index adapted from Kelly et al. (2011). A peak is significant if SNI > 3.

sd_threshold

numeric. Number of standard deviations above the trend required for a point to be classified as a peak (default = 2). Used by "trend_linear" and "trend_non_linear".