Skip to contents

With offspring probabilities p[1], p[2], ... for 0, 1, 2, ... triggered events, the chain started by one event dies out with probability equal to the smallest fixed point of the generating function \(f(s) = \sum_k p_k s^k\) in \([0, 1]\), reached as the limit of \(s_0 = 0\), \(s_{n+1} = f(s_n)\) (Research.P10.iter_tendsto, extinction_fixed, extinction_le_fixed). When the mean offspring \(m = \sum_k k p_k\) is below one the only fixed point is one and extinction is certain (subcritical_extinction_one); above one a fixed point below one exists and extinction has probability strictly less than one (supercritical_extinction_lt_one). The branching ratio of morie_contagion_branching is this \(m\); the function gives the probability that any particular chain ends, which the ratio alone does not.

Usage

morie_contagion_extinction(p, tol = 1e-14, max_iter = 100000L)

Arguments

p

Offspring probabilities for 0, 1, 2, ... children; non-negative, summing to one.

tol

Stop iterating when consecutive iterates differ by less than this.

max_iter

Iteration cap.

Value

A list with mean_offspring, regime ("subcritical", "critical" or "supercritical"), extinction (the smallest fixed point), iterates (the monotone sequence), survival (1 - extinction), fixed_point_check (\(f(q) - q\)) and theorems.

Examples

morie_contagion_extinction(c(0.3, 0.3, 0.4))   # mean 1.1: survives with positive probability
#> $mean_offspring
#> [1] 1.1
#> 
#> $regime
#> [1] "supercritical"
#> 
#> $extinction
#> [1] 0.75
#> 
#> $survival
#> [1] 0.25
#> 
#> $iterates
#>   [1] 0.3000000 0.4260000 0.5003904 0.5502733 0.5862023 0.6133139 0.6344558
#>   [8] 0.6513504 0.6651080 0.6764799 0.6859940 0.6940333 0.7008829 0.7067596
#>  [15] 0.7118315 0.7162311 0.7200641 0.7234162 0.7263572 0.7289451 0.7312279
#>  [22] 0.7332461 0.7350338 0.7366200 0.7380296 0.7392839 0.7404015 0.7413982
#>  [29] 0.7422880 0.7430830 0.7437938 0.7444298 0.7449993 0.7455093 0.7459665
#>  [36] 0.7463763 0.7467439 0.7470738 0.7473698 0.7476356 0.7478743 0.7480887
#>  [43] 0.7482813 0.7484543 0.7486098 0.7487496 0.7488753 0.7489883 0.7490899
#>  [50] 0.7491812 0.7492633 0.7493372 0.7494037 0.7494635 0.7495172 0.7495656
#>  [57] 0.7496091 0.7496483 0.7496835 0.7497152 0.7497437 0.7497693 0.7497924
#>  [64] 0.7498132 0.7498319 0.7498487 0.7498639 0.7498775 0.7498897 0.7499008
#>  [71] 0.7499107 0.7499196 0.7499277 0.7499349 0.7499414 0.7499473 0.7499525
#>  [78] 0.7499573 0.7499616 0.7499654 0.7499689 0.7499720 0.7499748 0.7499773
#>  [85] 0.7499796 0.7499816 0.7499835 0.7499851 0.7499866 0.7499879 0.7499891
#>  [92] 0.7499902 0.7499912 0.7499921 0.7499929 0.7499936 0.7499942 0.7499948
#>  [99] 0.7499953 0.7499958 0.7499962 0.7499966 0.7499969 0.7499972 0.7499975
#> [106] 0.7499978 0.7499980 0.7499982 0.7499984 0.7499985 0.7499987 0.7499988
#> [113] 0.7499989 0.7499990 0.7499991 0.7499992 0.7499993 0.7499994 0.7499994
#> [120] 0.7499995 0.7499995 0.7499996 0.7499996 0.7499997 0.7499997 0.7499997
#> [127] 0.7499998 0.7499998 0.7499998 0.7499998 0.7499998 0.7499999 0.7499999
#> [134] 0.7499999 0.7499999 0.7499999 0.7499999 0.7499999 0.7499999 0.7499999
#> [141] 0.7499999 0.7499999 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [148] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [155] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [162] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [169] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [176] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [183] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [190] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [197] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [204] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [211] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [218] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [225] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [232] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [239] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [246] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [253] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [260] 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000 0.7500000
#> [267] 0.7500000 0.7500000
#> 
#> $fixed_point_check
#> [1] 8.65974e-15
#> 
#> $theorems
#> [1] "Research.P10.iter_mono"                      
#> [2] "Research.P10.iter_tendsto"                   
#> [3] "Research.P10.extinction_fixed"               
#> [4] "Research.P10.extinction_le_fixed"            
#> [5] "Research.P10.subcritical_extinction_one"     
#> [6] "Research.P10.supercritical_extinction_lt_one"
#> 
morie_contagion_extinction(c(0.5, 0.3, 0.2))   # mean 0.7: dies out
#> $mean_offspring
#> [1] 0.7
#> 
#> $regime
#> [1] "subcritical"
#> 
#> $extinction
#> [1] 1
#> 
#> $survival
#> [1] 2.242651e-14
#> 
#> $iterates
#>  [1] 0.5000000 0.7000000 0.8080000 0.8729728 0.9143081 0.9414843 0.9597238
#>  [8] 0.9721311 0.9806471 0.9865279 0.9906058 0.9934417 0.9954178 0.9967967
#> [15] 0.9977597 0.9984328 0.9989035 0.9992327 0.9994630 0.9996241 0.9997369
#> [22] 0.9998159 0.9998711 0.9999098 0.9999368 0.9999558 0.9999691 0.9999783
#> [29] 0.9999848 0.9999894 0.9999926 0.9999948 0.9999964 0.9999975 0.9999982
#> [36] 0.9999988 0.9999991 0.9999994 0.9999996 0.9999997 0.9999998 0.9999999
#> [43] 0.9999999 0.9999999 0.9999999 1.0000000 1.0000000 1.0000000 1.0000000
#> [50] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> [57] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> [64] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> [71] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> [78] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
#> [85] 1.0000000 1.0000000
#> 
#> $fixed_point_check
#> [1] 6.77236e-15
#> 
#> $theorems
#> [1] "Research.P10.iter_mono"                      
#> [2] "Research.P10.iter_tendsto"                   
#> [3] "Research.P10.extinction_fixed"               
#> [4] "Research.P10.extinction_le_fixed"            
#> [5] "Research.P10.subcritical_extinction_one"     
#> [6] "Research.P10.supercritical_extinction_lt_one"
#>