Type: | Package |
Title: | Identify Changes in Mean |
Version: | 0.3 |
Date: | 2024-07-12 |
Maintainer: | Michael Marks <michaelmarks@analyticaconsulting.com> |
Description: | A basic implementation of the change in mean detection method outlined in: Taylor, Wayne A. (2000) https://variation.com/wp-content/uploads/change-point-analyzer/change-point-analysis-a-powerful-new-tool-for-detecting-changes.pdf. The package recursively uses the mean-squared error change point calculation to identify candidate change points. The candidate change points are then re-estimated and Taylor's backwards elimination process is then employed to come up with a final set of change points. Many of the underlying functions are written in C++ for improved performance. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Imports: | Rcpp (≥ 1.0.4), dplyr, purrr, tidyr, magrittr, rlang |
LinkingTo: | Rcpp |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Suggests: | knitr, rmarkdown, ggplot2, bench |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
NeedsCompilation: | yes |
Packaged: | 2024-07-12 20:39:00 UTC; mmark |
Author: | Michael Marks [aut, cre] |
Depends: | R (≥ 3.5.0) |
Repository: | CRAN |
Date/Publication: | 2024-07-14 13:00:02 UTC |
Identify Changes in Mean
Description
A basic implementation of the change in mean detection method outlined in: Taylor, Wayne A. (2000) <https://variation.com/wp-content/uploads/change-point-analyzer/change-point-analysis-a-powerful-new-tool-for-detecting-changes.pdf>. The package recursively uses the mean-squared error change point calculation to identify candidate change points. The candidate change points are then re-estimated and Taylor's backwards elimination process is then employed to come up with a final set of change points. Many of the underlying functions are written in C++ for improved performance.
Details
ChangePointTaylor
A basic implementation of the change in mean detection method outlined in: Taylor, Wayne A. (2000) <https://variation.com/wp-content/uploads/change-point-analyzer/change-point-analysis-a-powerful-new-tool-for-detecting-changes.pdf>. The package recursively uses the mean-squared error change point calculation to identify candidate change points. The candidate change points are then re-estimated and Taylor's backwards elimination process is then employed to come up with a final set of change points. Many of the underlying functions are written in C++ for improved performance.
Author(s)
Michael Marks <michaelmarks@analyticaconsulting.com>
US Trade Deficit Data: 1987-1988.
Description
A replication of the US Trade Deficit data used in Taylor's manuscript.
Usage
US_Trade_Deficit
Format
A data frame with 24 rows and 2 variables:
- date
observation month
- deficit_billions
US trade deficit in billions of dollars
...
change_point_analyzer
Description
a simple implementation of the change in mean detection methods developed by Wayne Taylor and utilized in his Change Point Analyzer software. The package recursively uses the 'MSE' change point calculation to identify candidate change points. Taylor's backwards elimination process is then employed to come up with a final set of change points.
Usage
change_point_analyzer(
x,
labels = NA,
n_bootstraps = 1000,
min_candidate_conf = 0.5,
min_tbl_conf = 0.9,
CI = 0.95
)
Arguments
x |
a numeric vector |
labels |
a vector the same length as |
n_bootstraps |
an integer value. Determines the number of bootstraps when calculating the change confidence level. |
min_candidate_conf |
a value between 0 and 1. The minimum change confidence level to become a candidate change point before re-estimation and backwards elimination. |
min_tbl_conf |
a value between 0 and 1. The minimum change confidence level below which a candidate change point will be eliminated after re-estimation and backwards elimination. |
CI |
a value between 0 and 1. The value of the confidence interval. |
Value
a dataframe containing the change points, their confidence levels, and other relevant information
References
Taylor, W. A. (2000). Change-point analysis: a powerful new tool for detecting changes.
Examples
x <- US_Trade_Deficit$deficit_billions
label_vals <- US_Trade_Deficit$date
change_point_analyzer(x)
change_point_analyzer(x, label = label_vals)
change_point_analyzer(x, label = label_vals, n_bootstraps = 10000)
change_point_analyzer(x, label = label_vals, min_candidate_conf = 0.66, min_tbl_conf = 0.95)