This function estimates the incubation period distribution of a post-infectious syndrome with maximum likelihood estimation. The incubation period distribution of the antecedent infection and the post-infectious syndrome are allowed to be lognormal ("LN"), Weibull ("WB") or gamma ("GM") distributed. The data set is allowed to have cases with the actecedent diseases whose incuation periods come from different distributions (see Examples).
pis.fit(data,postinfect=c("LN","WB","GM"),theta)A data.frame containing at least 4 columns. The first two columns represent (1) the time between the symptom onset of the antecedent infection and post-infectious syndrome and (2) the incubation period distribution of the antecedent infection (only "LN", "WB" and "GM"). The last two columns refer to the parameters of the incubation period distribution of the antecedent infection; for "LN", they are meanlog and sdlog as in dlnorm; for "WB", they are shape and scale as in dweibull; for "GM", they are shape and rate as in dgamma.
The incubation period distribution of the post-infectious disease. It can only be "LN", "WB" and "GM".
A vector of two numbers as the initial value for optimisation.
Estimates of the parameters of the incubation period distribution of the post-infectious syndrome.
Standard errors of Parameter
Akaike Information Criterion.
The convergence message of optim
The median incubation period distribution of the post-infectious syndrome.
Initial values used in optim
The Distribution assumed in the estimation, i.e. "LN", "WB" or "GM".
For each observed case, let \(S_{0}\) and \(S\) be the incubation period of the antecedent infection and post-infectious syndrome, respectively. As the antecedent infection is the antigenic factor of the post-infectious syndrome, they both share the same time of infection exposure. The difference between \(S_{0}\) and \(S\), denoted by \(X\), is the time between the two symptom onsets. Also let \(\theta_{0}\) and \(\theta\) be the set of the parameters of the distribution of \(S_{0}\) and \(S\) then the likelihood of such observed case is given by, $$\int_{-\infty}^{\infty}f_0(S_0,\theta_0)f(S_0+X,\theta)dS_0$$ where \(f_0\) and \(f\) are the probability density function of \(S_{0}\) and \(S\), respectively. \(\theta\) is then estimated by maximising the sum of likelihood of all observed cases.
# NOT RUN {
#generate artificial data
S<-c(56,37,32,7,8,3,5)
S0<-c(2,1,3,1,1,1,3)
X<-S-S0
f0<-c(rep("LN",4),rep("WB",3))
phi<-matrix(c(rep(c(0,1),4),rep(c(1,2),3)),byrow=TRUE,ncol=2)
data<-data.frame(X,f0,phi)
pis.fit(data,"LN",theta=c(2.5,1))
# }
Run the code above in your browser using DataLab