Skip to contents

Disruptions: the steps that changed a graph far more than usual. The change of a step is 1 - jaccard; a step is flagged when its change is more than threshold robust standard deviations above the median of all steps. (The robust standard deviation is the MAD; when more than half of the steps change nothing, the MAD is 0 and the ordinary standard deviation is used instead.)

Usage

vp_disruptions(history, threshold = 3.5)

Arguments

history

A history: the versions of a model, from vp_read_history() or vp_history(), oldest first.

threshold

How many robust standard deviations above the median a change must be to count as a disruption.

Value

The rows of vp_history_changes() with two more columns: score and disruption (TRUE/FALSE).

Examples

gens <- c("miband1", "miband2", "miband3", "miband4", "miband6")
history <- vp_history(
  vp_example(paste0(gens, "_realized.uvl")),
  versions = gens,
  or_graph = TRUE
)
vp_disruptions(history)
#> # A tibble: 12 × 15
#>     step from   to    graph  kept added removed old_links new_links gained  lost
#>    <int> <fct>  <fct> <chr> <int> <int>   <int>     <int>     <int>  <int> <int>
#>  1     1 miban… miba… requ…     0     8       0         0         0      0     0
#>  2     1 miban… miba… excl…     0     8       0         0         0      0     0
#>  3     1 miban… miba… atle…     0     8       0         0         0      0     0
#>  4     2 miban… miba… requ…     8     3       0         6        17     11     0
#>  5     2 miban… miba… excl…     8     3       0         3         9      6     0
#>  6     2 miban… miba… atle…     8     3       0         0         3      3     0
#>  7     3 miban… miba… requ…    11     6       0        21        22     11    10
#>  8     3 miban… miba… excl…    11     6       0        10        18      8     0
#>  9     3 miban… miba… atle…    11     6       0         3         1      0     2
#> 10     4 miban… miba… requ…    17     4       0        32        73     45     4
#> 11     4 miban… miba… excl…    17     4       0        35        54     23     4
#> 12     4 miban… miba… atle…    17     4       0         1         1      0     0
#> # ℹ 4 more variables: jaccard <dbl>, spearman <dbl>, score <dbl>,
#> #   disruption <lgl>