m3掲示板が「特養でコロナ感染」棄却の話題で盛り上がっていた。
家族もPCR陽性だったのが判決に影響したようだ。
発症順が感染順とは限らない という趣旨の投稿をしたら賛同を得た。

んで、こういう問題を考えてみた。

臨床問題

オミクロン株の潜伏期は中央値で2.9日とされる。
https://www.niid.go.jp/niid/ja/2019-ncov/2551-cepr/10903-b11529-period.html
子供が発症した翌日に親が発症したとする。
親の方が先に感染していた確率を上記のurlのデータと計算に必要な仮定を適宜おいて計算せよ。

n=c(2,8,15,9,1)
N=sum(n)
X=rep(1:5,n)
fitw=fitdist(X,'weibull')
fitw$estimate
optw=optim(fitw$estimate,\(x) ss(x,pweibull))
shape=optw$par[1]
scale=optw$par[2]
f <- function(x,y) dweibull(x+y,shape,scale)*dweibull(y,shape,scale)
vf=Vectorize(f,vectorize.args = 'y')
pdf <- function(x) integrate(function(y) vf(x,y),-Inf,Inf)$value
pdf=Vectorize(pdf)
cdf=function(x) integrate(pdf,-1,x)$value
cdf=Vectorize(cdf)
cdf(2)-cdf(1)

k=1e5
d=rweibull(k,shape,scale) - rweibull(k,shape,scale)
mean(1<d & d<2)