A formal test of whether a degree distribution follows a power law (Clauset et al.). A small p-value (below 0.1) rejects the power law. Test the skeleton: in the complete graph, any deep hierarchy gives a long tail by itself.
Usage
vp_power_law(model, graph = c("skeleton", "requires", "excludes"), seed = 1)Arguments
- model
A model, from
vp_generate()orvp_read(), in its complete or its minimal form.- graph
Which graph:
"requires","excludes"or"atleastone"(the last one needsor_graph = TRUEinvp_generate()).- seed
The seed of the random numbers, so that the result can be repeated. The random state of the session is left as it was.
Value
One row: graph, features (with a degree above 0), alpha,
xmin, p_value and verdict. The p-value comes from a simulation;
seed makes it repeatable.
Examples
# \donttest{
bb <- vp_generate(vp_example("busybox_01.uvl"))
vp_power_law(bb)
#> # A tibble: 1 × 6
#> graph features alpha xmin p_value verdict
#> <chr> <int> <dbl> <dbl> <dbl> <chr>
#> 1 skeleton 159 1.98 1 0.0092 not a power law
# }