simCrossSect.Rd
These are the available incidence functions. t
is relative to time 0.
So, to get incidence 2 years ago, t = -2
.
simCrossSect(
phi.func,
incidence_type,
prevalence,
baseline_incidence,
rho = NA,
bigT = NA
)
Incidence type: constant, linear, exponential, or linear-constant (constant up to bigT
argument, linear after)
Constant prevalence
Baseline incidence
Parameter for linear or exponentially decreasing incidence
Number of simulations
Number of observations per time point
Constant prevalence
Time t baseline (defaults to 0)
Constant incidence: $$\lambda(t) = \lambda_0 - \rho$$ Linear incidence: $$\lambda(t) = \lambda_0 - \rho t$$ Exponential incidence: $$\lambda(t) = \lambda_0 \exp(-\rho t)$$ Constant-linear incidence: $$\lambda(t) = \lambda_0 - \rho (t + T^*) I(-t > T^*)$$
phi.func <- getTestRecentFunc(window=200, shadow=191)
sim <- simCrossSect(phi.func=phi.func,
incidence_type="linear", prevalence=0.29, baseline_incidence=0.032, rho=0.07)
sim(10)
#> di ui ri
#> 1 0 NA NA
#> 2 0 NA NA
#> 3 0 NA NA
#> 4 0 NA NA
#> 5 0 NA NA
#> 6 0 NA NA
#> 7 0 NA NA
#> 8 0 NA NA
#> 9 0 NA NA
#> 10 1 0.7248768 0