Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rt Notebook example - corrected #1523

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ relevant code.

## Miscellaneous
- [The example shown on the landing page](./sampling/readme-example.ipynb)
- [Rt estimation Renewal Equation model](./miscellaneous/model-rt-estimation-renewal-equation.ipynb)
1,973 changes: 1,973 additions & 0 deletions examples/miscellaneous/model-rt-estimation-renewal-equation.ipynb

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions examples/miscellaneous/negbin_rt.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
,Time Points,Mean,Median,Lower bound CI,Upper bound CI,Central Probability
0,7,6.851351999492065,6.136387501726331,1.686252653977923,15.38240615556736,0.95
1,8,7.618165371882501,7.152484501254506,2.557113873799544,15.508937816677712,0.95
2,9,7.870754054689776,7.4475099106056835,3.0271497413615345,15.44027429868353,0.95
3,10,6.135900327304794,5.749526588347118,2.2612108957718315,11.927851204375362,0.95
4,11,5.631640388851766,5.273006073926375,2.501526461154174,10.822379461340946,0.95
5,12,5.202017323135449,4.905288634956683,2.313941160249185,9.479491262383847,0.95
6,13,3.3945489097463004,3.189700810693,1.3117652052807571,6.612621535262575,0.95
7,14,2.8168944208404203,2.648115062093469,1.127557897960739,5.620075105680762,0.95
8,15,1.7339810349433398,1.6145407536988419,0.5983056995703628,3.580894468008412,0.95
9,16,1.8579896048332776,1.74534803255417,0.7719348509947087,3.5034022415297437,0.95
10,17,1.6017029825741145,1.503256778109017,0.6488983245575115,3.0841225562338384,0.95
11,18,1.6286022874731965,1.5478529664853773,0.6929429834415883,3.0544690664965963,0.95
12,19,2.0141966732731786,1.9347875063476814,0.9389414958098956,3.5840576177434773,0.95
13,20,4.011521906144785,3.910179549074618,2.3133725674749144,6.4013316321784295,0.95
14,21,7.306387939530312,7.103410265724518,4.6468031301751065,10.805171355391819,0.95
15,22,11.600855747814075,11.4170588270357,8.00902327111398,16.447552558356062,0.95
16,23,13.39620954545914,13.166995551265305,9.326759847706917,18.427866278867143,0.95
17,24,13.795930704433694,13.534413604412801,9.511141122182025,19.8651053660296,0.95
18,25,13.75807139672613,13.482809277826785,9.575454054106196,19.65489857323722,0.95
19,26,13.193583299189042,12.954552616434201,9.001609537387445,18.711598998163883,0.95
20,27,11.278251657566912,11.026897827636127,7.580967281806349,16.511557392264052,0.95
21,28,8.390824436190368,8.201325554888678,5.615839395593753,12.188041876242513,0.95
22,29,4.70920557253456,4.568267256443287,3.178161753404539,7.0044480038029295,0.95
23,30,2.895452809961549,2.8197375898372155,1.9082206594435034,4.330841895431299,0.95
24,31,2.4516675146039852,2.3991164962153215,1.6395638710643916,3.6167581983428163,0.95
25,32,1.9254655466632646,1.8855817623478246,1.2820423096101605,2.765192969086085,0.95
26,33,1.6803263176188605,1.6409102305871888,1.1220820143214947,2.4506898776321098,0.95
27,34,1.55336609426428,1.5271212186882406,1.0313874813057284,2.374601642377911,0.95
28,35,1.397146604434209,1.3727663606200966,0.9457852728585097,1.9729289926358953,0.95
29,36,1.3672607347035013,1.3429698515339126,0.9152725438678789,1.996911344470252,0.95
30,37,1.833411043278763,1.7980553848587195,1.248668706841775,2.6446678141661812,0.95
31,38,2.2637883342299308,2.2018280476882732,1.5404011368181638,3.3227664918080277,0.95
32,39,2.6452943038476353,2.6163769304492597,1.848978269077804,3.74814971448781,0.95
33,40,2.842855350423021,2.7890934834911785,1.9619678103420444,4.054031749977523,0.95
34,41,2.923515989934385,2.8509568509642156,2.0108514307215617,4.212283678328818,0.95
35,42,2.90657365667172,2.847750575718872,2.067763133950601,4.101553306467881,0.95
36,43,2.7466794912627495,2.6792665773961555,1.909146824348301,3.8928703845514896,0.95
37,44,2.160868263221678,2.1151021935648755,1.4866572140985694,3.0473074689388913,0.95
38,45,1.6342962714280211,1.597419437225968,1.1189577437909928,2.3586835176644674,0.95
39,46,1.2362669013482346,1.2098532550039502,0.8353735519174988,1.8047859631252827,0.95
40,47,0.9384486749482064,0.9281051361632563,0.6460128795810736,1.3365419996545842,0.95
41,48,0.7560901195609815,0.7366688413780544,0.5256428916421325,1.109197068797789,0.95
42,49,0.7220705724073395,0.7007500998245935,0.49244967219532176,1.0581882314861812,0.95
43,50,0.7294591497836475,0.7140370975472894,0.4886195336707719,1.0698588677223164,0.95
44,51,0.6998557379548004,0.6839860503427797,0.4766652265195109,1.0097980030657925,0.95
45,52,0.6779020435896196,0.6617186415305595,0.4709986196074829,0.9616968849121016,0.95
46,53,0.6590748444695341,0.644362828478197,0.447853208968517,0.9650443788833042,0.95
47,54,0.6355076898963806,0.621912271173622,0.4265763828434628,0.9201631376048649,0.95
48,55,0.6521535755668805,0.6357417263030853,0.4321088335559044,0.9680542836020063,0.95
49,56,0.6227005847380818,0.6078852870264624,0.41763518204388,0.9316930058062136,0.95
50,57,0.5861631187076994,0.5693850328788272,0.3863144876451755,0.8891095973297768,0.95
51,58,0.5240015716196982,0.5096467968782443,0.3497654806003788,0.7838512403979411,0.95
52,59,0.532307255268853,0.5180817805674782,0.35843818303086167,0.7753941790913876,0.95
53,60,0.5587978950504778,0.5436943817160123,0.37320501749034757,0.822142100490845,0.95
54,61,0.5499495196028048,0.5348411951691721,0.3636874907384612,0.8069459105975895,0.95
55,62,0.5583914052630193,0.5452993145434603,0.3613838978160446,0.8605899271969047,0.95
56,63,0.5837471453398306,0.5692612903816661,0.3781810679641882,0.8693365837533439,0.95
57,64,0.5580111407184319,0.5470293413779459,0.3750005210849204,0.8026026190823623,0.95
58,65,0.5399781075541532,0.5282272257431562,0.35323305198621746,0.8122643263429055,0.95
59,66,0.5145679037606831,0.5000948567731178,0.33462723431783586,0.75811651787852,0.95
60,67,0.4987556752872063,0.48556607025546233,0.3243572877993023,0.7637891789491984,0.95
61,68,0.5502239539078235,0.5389541668801232,0.35251036457304497,0.8366320864153807,0.95
62,69,0.5489533964286766,0.5347228588392078,0.3532350592217418,0.8194758733423552,0.95
63,70,0.5687626038489894,0.5494461308917722,0.36530311045422764,0.8598031831153826,0.95
64,71,0.6018881917637543,0.5848683237335426,0.38940806295980745,0.9049938593846518,0.95
65,72,0.744602973677761,0.7212623529753797,0.48149019597888226,1.1215294921393815,0.95
66,73,0.721677680068264,0.7105397606212376,0.4470719733012058,1.0919524718329017,0.95
67,74,0.7559462726735642,0.7369925740957903,0.48435723858307594,1.1316134740438408,0.95
68,75,0.6938971366993639,0.6703691142726689,0.44361125931125006,1.0824600992764637,0.95
69,76,0.6411311868006632,0.6241938236290434,0.4041312565456497,0.9874582451758377,0.95
70,77,0.5762647935632041,0.562327474093611,0.3454914985184998,0.9042795199912154,0.95
71,78,0.6007321761465356,0.5805997460902028,0.36767873357514896,0.927874539475927,0.95
72,79,0.49377415538163316,0.4823201204291102,0.28657112780214755,0.7827635649526501,0.95
73,80,0.5436322990665936,0.5292606614596895,0.320373293200342,0.8649775941164674,0.95
74,81,0.5131121348833074,0.4976061235191354,0.2945337607518473,0.8187292020601525,0.95
75,82,0.6531523079361218,0.6351107973032815,0.3815145547432355,1.0416229330220677,0.95
76,83,0.6528052991427843,0.6311298442411963,0.391584960257644,1.0075376816383679,0.95
77,84,0.6713857951287833,0.6519231595933397,0.39172684438647754,1.0660400872483602,0.95
78,85,0.6240157997459003,0.604499200546838,0.3688828949097327,1.0120930003373967,0.95
79,86,0.7015486956897861,0.677026762078427,0.40619938144033096,1.1405910094328915,0.95
80,87,0.6985212096045393,0.6813454169969766,0.4028685233037967,1.1130094635031658,0.95
81,88,0.7092013753998874,0.6864488491808219,0.4090088673356588,1.1704401044441193,0.95
82,89,0.6425766023372105,0.6183852151939938,0.35717236942777997,1.052973899165087,0.95
83,90,0.7096070339754095,0.6768979104446636,0.39227988276660475,1.180799179748232,0.95
84,91,0.6751082757043918,0.6489670607794822,0.37151018923352913,1.1500718023396441,0.95
85,92,0.7041914805153637,0.6809525074514379,0.3884771605299663,1.1582595639763487,0.95
86,93,0.5611856373709946,0.5393855262265639,0.2871807078535077,0.9595767792835561,0.95
87,94,0.5214093188185296,0.495817400868625,0.24690123244401943,0.9196964523409502,0.95
88,95,0.5574437562275331,0.5308472196203967,0.2802540372493299,0.9893605856066033,0.95
89,96,0.5434806967243156,0.5103410092189604,0.2654866438130055,1.032441863091827,0.95
90,97,0.5059174770868792,0.4800556026489314,0.23827632526485415,0.9253338854575253,0.95
91,98,0.5298544435789343,0.5069866253979611,0.2538942846189618,0.9462623772289225,0.95
92,99,0.5224586440933112,0.5013486207662011,0.25370414377955697,0.9228447234705054,0.95
93,100,0.6120354296630599,0.5840590785687971,0.2844240752904155,1.1057715054321313,0.95
94,101,0.6401415137033595,0.5992774014079141,0.2978645378976517,1.1814373480068356,0.95
95,102,0.5826772599201773,0.5518605828094243,0.24573438393976746,1.1101302095653514,0.95
96,103,0.513740465041276,0.4865459132104617,0.20213408505767702,0.9750340148407196,0.95
97,104,0.4882247414149966,0.45293796065035874,0.18372688258290776,1.0428317243773813,0.95
98,105,0.6014213976917796,0.5599491040706857,0.23216297084671,1.2158313985871532,0.95
99,106,0.5522239482997511,0.5082963809610102,0.21298531139257848,1.1251718175686487,0.95
101 changes: 101 additions & 0 deletions examples/miscellaneous/pois_rt.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
,Time Points,Mean,Median,Lower bound CI,Upper bound CI,Central Probability
0,7,6.52974688386283,6.149553819098205,1.7694692430674586,13.414468289381015,0.95
1,8,7.3772355715673115,7.079231777195094,2.785560976226629,13.89539286614282,0.95
2,9,7.6699996317472126,7.348550892642702,3.4480438190787672,13.50838968407027,0.95
3,10,6.064789510054981,5.8103635977840575,2.4696001624401105,11.372009912025744,0.95
4,11,5.423101414196482,5.135116726394212,2.402718251635486,9.729608057994456,0.95
5,12,4.813628826767605,4.672199024647202,2.3570853006158208,7.8673250044521605,0.95
6,13,3.0676873901857955,2.936674059242593,1.3187885271642867,5.619736301611973,0.95
7,14,2.5237780872388886,2.392248677959614,1.0716843218485927,4.584158815578486,0.95
8,15,1.5417624278204909,1.4495600552828238,0.5401036254339731,2.982285768828518,0.95
9,16,1.7144602184998887,1.6595126239891618,0.721347665697306,3.0140687456031725,0.95
10,17,1.5217633224346288,1.471844321319956,0.647446374804393,2.6537742419661425,0.95
11,18,1.5679493062863854,1.5129593557968446,0.7288905063446244,2.6825394353674517,0.95
12,19,1.9249747787160147,1.8748826405602435,0.9591846623595198,3.1184942454203552,0.95
13,20,3.928279011981372,3.8756557242703504,2.5457609166917377,5.571841877892265,0.95
14,21,7.254634287159036,7.208064155115164,5.276928880246017,9.410752496900972,0.95
15,22,12.154242947892994,12.119574147558819,9.59010122547027,14.8117587860813,0.95
16,23,14.395258000000622,14.32487930277557,11.698275281734333,17.367721286458355,0.95
17,24,13.481354455494106,13.451437360131916,11.08480503072759,16.12153882378409,0.95
18,25,11.345933306752118,11.312359199947895,9.487471127071128,13.317937442277469,0.95
19,26,8.558629312353142,8.556566798094856,7.2201909906367545,9.95078803069641,0.95
20,27,5.947321371111171,5.934844319648251,5.091443312317833,6.884022848174657,0.95
21,28,4.305491542204678,4.297038909585032,3.6279024383210774,5.03052584345767,0.95
22,29,2.9481869539984737,2.9409398728282516,2.4676949949432814,3.4640934243938983,0.95
23,30,2.3189442680574817,2.3095294284589367,1.9709508439773453,2.7056551855050492,0.95
24,31,2.0856887088511393,2.0824730125927187,1.777308412533048,2.441802761199848,0.95
25,32,1.7145050531324662,1.7128771261183504,1.4503417053495573,1.9878092912882663,0.95
26,33,1.5297461065442917,1.526260650607969,1.304665769469472,1.7717608319593083,0.95
27,34,1.4221896383352426,1.41463051062204,1.2247323702700355,1.6465046241006718,0.95
28,35,1.2933830562322859,1.2885213089523573,1.086261214826961,1.5045538167847843,0.95
29,36,1.2812798083476504,1.2769543497750764,1.097929011881449,1.4883144458957958,0.95
30,37,1.7922033130892268,1.7887129035250595,1.569279466347869,2.0236093390957417,0.95
31,38,2.221121143730807,2.215730116226276,1.9817846848108807,2.485349766001869,0.95
32,39,2.568723915257387,2.5652898445584453,2.3059549865404305,2.854363799896902,0.95
33,40,2.737412032224454,2.7358200794286613,2.4646868518376337,3.0218260375924544,0.95
34,41,2.779013726223814,2.7752947044282674,2.5317405332951153,3.034275267647301,0.95
35,42,2.6242089103532202,2.6234558102199914,2.377160392024499,2.8748082745674477,0.95
36,43,2.329051437365562,2.3242146686725107,2.115767984696302,2.546785386447394,0.95
37,44,1.771082445009084,1.770432916285814,1.5959171097774356,1.9577520698697692,0.95
38,45,1.3117145007453157,1.3095906605385255,1.1798760843487086,1.4548865399437987,0.95
39,46,1.0229440478903056,1.020748856197415,0.9036930436562625,1.1486750456953445,0.95
40,47,0.8246320046437169,0.8228149412666957,0.7237615595092728,0.9302476118316835,0.95
41,48,0.7021595342797922,0.702005540793004,0.609215241380952,0.7961077947658385,0.95
42,49,0.6699698431189559,0.669950156258565,0.5884392253189065,0.7589181790826508,0.95
43,50,0.68388584445841,0.6831796527608394,0.5970724594322743,0.7758566939059753,0.95
44,51,0.6560161830448907,0.6563020305055067,0.575690484397519,0.7444268225540802,0.95
45,52,0.6348118843344784,0.63372495103133,0.5502423889678406,0.7251985648078455,0.95
46,53,0.6181508405554409,0.6170101112250768,0.5393203064968053,0.7018694754907376,0.95
47,54,0.6063839761378212,0.606018889431366,0.5195559715210519,0.6957722638218207,0.95
48,55,0.6188783587046672,0.6175565967396416,0.5338001906534845,0.711621220930265,0.95
49,56,0.5940791389543568,0.5927571333995878,0.5064412086119228,0.6854767196459244,0.95
50,57,0.5528027827718595,0.5515538912550283,0.46932746609082926,0.6438923648070763,0.95
51,58,0.49511522771111677,0.4941737437441014,0.4181596566160605,0.5844307223852,0.95
52,59,0.4999610627725652,0.49943362107034706,0.4159200220275033,0.592114290950947,0.95
53,60,0.5238505286477013,0.522662314063209,0.4348146401249654,0.6231378692817003,0.95
54,61,0.5206029815779106,0.5196579503786944,0.42918047512109975,0.6183929640567506,0.95
55,62,0.5253367803114356,0.5226634639164673,0.43012998565950283,0.6350500757986595,0.95
56,63,0.5369101729172918,0.535465659053876,0.4370585575612402,0.6414544265322497,0.95
57,64,0.5234920332621512,0.5210253165234586,0.42462812700891445,0.6366190096316042,0.95
58,65,0.5184575576811051,0.5149186794568222,0.41400863492804235,0.6385083639744962,0.95
59,66,0.4868794329153746,0.4839427879872451,0.38227924421069764,0.5991455873548064,0.95
60,67,0.47011866989874684,0.4686687899889285,0.36824515610753855,0.5899946044047201,0.95
61,68,0.5176993667327838,0.5155583144111049,0.40667596475939627,0.6471490221716787,0.95
62,69,0.5065562338752782,0.502091306824919,0.3799037584477999,0.6530588617207743,0.95
63,70,0.5158193239031141,0.5131176224225693,0.39027852809427627,0.6546689850552334,0.95
64,71,0.5535874403949796,0.5516162353468269,0.4288663348958567,0.6963964995396401,0.95
65,72,0.683784054469628,0.6767686824626203,0.5365555847127692,0.8590609392224446,0.95
66,73,0.6797476290706824,0.6762878513433761,0.5197612601374763,0.8733728400363029,0.95
67,74,0.718452507517207,0.7139329749740226,0.548455877411964,0.9086882697150744,0.95
68,75,0.6580783356822378,0.6526423789652698,0.49732144044636484,0.8413036560349196,0.95
69,76,0.6105208198846841,0.6067891359071887,0.4552181747143327,0.7833711140545946,0.95
70,77,0.5464639974049692,0.5445440929012879,0.3867384909789162,0.7293101533789466,0.95
71,78,0.5639428918658668,0.5589781140989267,0.3989560568194703,0.7622118766834574,0.95
72,79,0.4638424867323423,0.4595314086256242,0.31463752832198355,0.6445686804447321,0.95
73,80,0.5113877138837077,0.5040602238021413,0.3553580127065544,0.702382405069788,0.95
74,81,0.4712225222579451,0.46562589838489543,0.3196689666995168,0.6579127955495727,0.95
75,82,0.6010373490563666,0.596485743262532,0.42454696805847225,0.8145236208312431,0.95
76,83,0.6080996241441259,0.5991456265995512,0.42778249479447605,0.8289680328633189,0.95
77,84,0.6307173989164592,0.6225467147955412,0.43334135200171786,0.8784799837308017,0.95
78,85,0.5960577765407711,0.5895044944928065,0.4034061114300069,0.8231687375886798,0.95
79,86,0.6616982126125613,0.6536924675138573,0.46274943456327366,0.9084090349186233,0.95
80,87,0.6574553273796188,0.6494059092909388,0.4255332887604265,0.9306898620358132,0.95
81,88,0.6726007738794817,0.6677485414748298,0.43750680197707625,0.9477912795574731,0.95
82,89,0.6062481284426078,0.5944770964705157,0.3682061892024694,0.9066651308201965,0.95
83,90,0.6629398006937008,0.6542560033999179,0.43233001678248173,0.9132662341841328,0.95
84,91,0.6380512814896766,0.6297567684996428,0.3963272390247196,0.9321755091206462,0.95
85,92,0.6636982353615051,0.6553472215631144,0.43021335048563547,0.962176664088525,0.95
86,93,0.5388292894917898,0.5275833383689944,0.3168019545784403,0.8180118269013176,0.95
87,94,0.4940647389956664,0.4819228916803771,0.27541750766287865,0.7844418517140584,0.95
88,95,0.52433548328158,0.5095110503844215,0.29936794377096526,0.8212318057717408,0.95
89,96,0.5084422209355194,0.49585970373314525,0.27322801921127904,0.8244663877734003,0.95
90,97,0.4645916311684229,0.45448709122715947,0.24281613634572974,0.749191216505325,0.95
91,98,0.49720061910804375,0.48260476958533505,0.2512391653875757,0.8351261002828634,0.95
92,99,0.4855803166886395,0.4727050426228703,0.24249166173578102,0.8166296183008022,0.95
93,100,0.5644680090432748,0.548058564206469,0.2883603087122838,0.925027702908244,0.95
94,101,0.6119631221966944,0.5986692753595364,0.32727695921981903,1.003780045081513,0.95
95,102,0.5533520206140655,0.5293530817854281,0.26602466251433843,0.9457224747471351,0.95
96,103,0.47469457925319103,0.4503024738319581,0.21277300652854886,0.8748729121868616,0.95
97,104,0.4475583254051142,0.42873725128027546,0.1797995586946553,0.8241828465325746,0.95
98,105,0.5512562177897949,0.5309581364076179,0.24705537926075763,0.9725335237315377,0.95
99,106,0.5154872571726565,0.49164340905949133,0.22652548651219512,0.9283987859514712,0.95
108 changes: 108 additions & 0 deletions examples/miscellaneous/sars_incidence.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
"day","incidence"
1,1
2,0
3,0
4,1
5,0
6,0
7,2
8,0
9,2
10,2
11,1
12,1
13,1
14,0
15,0
16,0
17,4
18,1
19,2
20,4
21,13
22,23
23,35
24,26
25,12
26,17
27,19
28,17
29,28
30,23
31,27
32,27
33,11
34,21
35,21
36,25
37,31
38,103
39,96
40,69
41,58
42,48
43,33
44,25
45,43
46,37
47,30
48,29
49,28
50,34
51,34
52,32
53,24
54,17
55,16
56,23
57,18
58,15
59,11
60,19
61,16
62,9
63,17
64,14
65,6
66,4
67,8
68,9
69,11
70,11
71,11
72,6
73,13
74,3
75,8
76,2
77,4
78,4
79,6
80,4
81,5
82,4
83,8
84,2
85,3
86,2
87,5
88,3
89,3
90,4
91,3
92,1
93,2
94,0
95,1
96,3
97,3
98,1
99,1
100,1
101,1
102,1
103,1
104,1
105,0
106,2
107,0
26 changes: 26 additions & 0 deletions examples/miscellaneous/sars_serial_interval.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"day","w"
1,0
2,0.001
3,0.012
4,0.043
5,0.078
6,0.104
7,0.117
8,0.116
9,0.108
10,0.094
11,0.078
12,0.063
13,0.049
14,0.038
15,0.028
16,0.021
17,0.015
18,0.011
19,0.008
20,0.005
21,0.004
22,0.003
23,0.002
24,0.001
25,0.001
Loading