find_change_point | R Documentation |
Find the change point in count data. This is a backwards-compatible wrapper function to find the changepoint, which calls other methods.
find_change_point( data, var_name = "n_miss_visits", method, eval_criteria = "AIC", return_miss_only = FALSE, week_period = FALSE, specify_cp = NULL, auto_reg = FALSE )
data |
A dataset of visit counts, output by prep_cp_data |
var_name |
The name of the count variable to find the change-point for |
method |
The method used to find changepoint. Options include "lm", "lm_quad", "lm_cube", "quad", "cube", "exp", "spline", "pettitt", "cusum", "MSE", "RMSE", "MAE", "MSLE", "RMSLE" |
eval_criteria |
The evaluation criteria used to find change points, if using a linear regression method |
return_miss_only |
Logical argument to only return the tibbles of miss visit counts |
week_period |
Logical to incorporate a "day of the week" effect into the linear mode. Note this is only sensible for one-day period aggregation |
specify_cp |
Set a specific change point you want to use instead of searching for optimal change point. Enter a postive integer value repersenting the days before the index on which you you want to specify the change point. (e.g. 100 would be 100 days before the index) |
auto_reg |
Logical that determines whether expected counts use a time-series framework that incorporates autoregression. Will automatically fit periodicity, automatically setting week_period to TRUE. Only relevant for cusum and pettitt methods |
A list containing tibbles of information about missed visits. These tibbles change depending on the method used, but all contain miss predictions and a plot
cp_result_original <- final_time_map %>% prep_cp_data(event_name = "any_ssd", start_day = 1, by_days = 1) %>% find_change_point(var_name="n_miss_visits", method="lm_cube")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.