R0 is the spectral radius of the next generation matrix. The dominant eigenvalue is found by power iteration, which converges for a non-negative primitive matrix by Perron-Frobenius; the same theorem is why the dominant eigenvector – the stable distribution of infections across groups – can be reported with a positive sign. Homogeneous mixing collapses to R0 = c n / gamma, the closed form the tests check.
References
Diekmann and Heesterbeek (2000), Mathematical Epidemiology of Infectious Diseases, Wiley, ch. 5; Diekmann, Heesterbeek and Metz (1990), Journal of Mathematical Biology 28(4):365-382. doi:10.1007/BF00178324
Examples
Hetmix(contact_matrix = 5L, gamma = 0.5)
#> $estimate
#> [1] 10
#>
#> $R0
#> [1] 10
#>
#> $stable_distribution
#> [1] 1
#>
#> $iterations
#> [1] 2
#>
#> $epidemic
#> [1] 1
#>
#> $n
#> [1] 1
#>
#> $method
#> [1] "spectral radius of K = C diag(1/gamma), Diekmann & Heesterbeek (2000) ch. 5"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
