diff_model: A diff_model object is returned by play_diffusion() or as_diffusion() and contains a single empirical or simulated diffusion.
diff_models: A diff_models object is returned by play_diffusions() and contains a series of diffusion simulations.
Mahalanobis distance
test_gof() takes a single diff_model object, which may be a single empirical or simulated diffusion, and a diff_models object containing many simulations. Note that currently only the goodness of fit of the
It returns a tibble (compatible with broom::glance()) that includes the Mahalanobis distance statistic between the observed and simulated distributions. It also includes a p-value summarising a chi-squared test on this statistic, listing also the degrees of freedom and number of observations. If the p-value is less than the convention 0.05, then one can argue that the first diffusion is not well captured by
Examples
# test_distribution(play_diffusion(ison_networkers), # play_diffusion(ison_networkers, thresholds = 75))# Playing a reasonably quick diffusion# x <- play_diffusion(generate_random(15), transmissibility = 0.7)# Playing a slower diffusion# y <- play_diffusions(generate_random(15), transmissibility = 0.1, times = 40)# plot(x)# plot(y)# test_fit(x, y)