| Title: | Inference for Infectious Disease Transmission in SIR Framework |
|---|---|
| Description: | Model and estimate the model parameters for the spatial model of individual-level infectious disease transmission in Susceptible-Infected-Recovered (SIR) framework. |
| Authors: | Ruwani Herath [aut, cre], Leila Amiri [ctb], Mahmoud Torabi [ctb] |
| Maintainer: | Ruwani Herath <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.2.1 |
| Built: | 2026-06-02 10:34:01 UTC |
| Source: | https://github.com/cran/GDILM.SIR |
The data which describes the sociodemographic characters (proportion of indigenous people, proportions of immigrants, proportion of low education, median household income) for 96 regions.
Area_Level_DataArea_Level_Data
A data frame with 96 rows and 5 columns:
Region name
percentage of immigrants in each region
percentage of indigenous people in each region
proportion of persons 15+ who have not graduated high school
median household income
...
The data which describes the Individual characteristics (gender, age group, infected status) and corresponding area details for 700 individuals.
Individual_Level_DataIndividual_Level_Data
A data frame with 700 rows and 8 columns:
Disease status of the individual
The regioal health authority of the individual
Gender of the individual
Age group of the individual
postal code which the individual belong to
longitude of the region
latitude of the region
Region number assigned for each regional health authority
...
This function is used to estimate model parameters
Realdata_Finalmodel( ITER, zz, lambda0, sigma0, Di, D, n, time, tau, lambda, alpha0, q1, q2, cov1, cov2, phi, delta0, Nlabel, npar, I )Realdata_Finalmodel( ITER, zz, lambda0, sigma0, Di, D, n, time, tau, lambda, alpha0, q1, q2, cov1, cov2, phi, delta0, Nlabel, npar, I )
ITER |
Number of iterations |
zz |
Number of Regions |
lambda0 |
Spatial dependence |
sigma0 |
precision |
Di |
Euclidean distance between susceptible individual and infectious individual |
D |
Neighborhood structure |
n |
total number of individuals |
time |
time |
tau |
tau |
lambda |
lambda ### |
alpha0 |
intercept |
q1 |
Number of variables corresponding to individual level data |
q2 |
Number of variables corresponding to area level data |
cov1 |
Individual level covariates |
cov2 |
Area level covariates |
phi |
Spatial random effects |
delta0 |
Spatial parameter |
Nlabel |
Label for each sample from the area |
npar |
number of parameters |
I |
Identity matrix |
Numerical values for estimates
Realdata_Finalmodel(2,4,0.2,0.5, matrix(runif(400,min = 4,max = 20),nrow=20, byrow = TRUE), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE),20,10, sample(c(0,1),replace = TRUE, size = 20),rep(3,20),0.4,6,5, matrix(runif(120, 0, 1),nrow=20,byrow=TRUE), matrix(runif(20, 0, 1),nrow=4,byrow=TRUE),runif(4,min = 0, max = 1),2, rep(1:4,each=5),15,diag(4))Realdata_Finalmodel(2,4,0.2,0.5, matrix(runif(400,min = 4,max = 20),nrow=20, byrow = TRUE), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE),20,10, sample(c(0,1),replace = TRUE, size = 20),rep(3,20),0.4,6,5, matrix(runif(120, 0, 1),nrow=20,byrow=TRUE), matrix(runif(20, 0, 1),nrow=4,byrow=TRUE),runif(4,min = 0, max = 1),2, rep(1:4,each=5),15,diag(4))
Calculating the estimated values for the parameters using log-likelihood function
Sim_Estpar( Nlabel, phi, Di, alpha1, delta, lambda1, sigma1, beta1, beta2, zz, time, n, tau, lambda, I, D, cov1, cov2 )Sim_Estpar( Nlabel, phi, Di, alpha1, delta, lambda1, sigma1, beta1, beta2, zz, time, n, tau, lambda, I, D, cov1, cov2 )
Nlabel |
Label for each sample from the area |
phi |
Spatial random effects |
Di |
Euclidean distance between susceptible individual and infectious individual |
alpha1 |
intercept |
delta |
Spatial parameter |
lambda1 |
Spatial dependence |
sigma1 |
precision of spatial random effects |
beta1 |
the parameter corresponding to the covariate associated with susceptible individual |
beta2 |
the parameter corresponding to the covariate associated with area |
zz |
Number of areas |
time |
Time |
n |
Total number of individuals |
tau |
the set of infectious individuals at time t in the zth area |
lambda |
a vector containing the length of infectious period |
I |
identity matrix |
D |
Neighborhood structure |
cov1 |
Individual level covariates |
cov2 |
Area level covariates |
a list of the solutions for the estimations of the parameters
Sim_Estpar(rep(1:4,each=5),runif(4,min = 0, max = 1), matrix(runif(400,min=4,max=20),nrow=20,byrow = TRUE),0.4,3,0.2,0.5,1,1,4,10, 20,sample(c(0,1),replace = TRUE, size = 20),rep(3,20),diag(4), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), runif(20, 0, 1),runif(4, 0, 1))Sim_Estpar(rep(1:4,each=5),runif(4,min = 0, max = 1), matrix(runif(400,min=4,max=20),nrow=20,byrow = TRUE),0.4,3,0.2,0.5,1,1,4,10, 20,sample(c(0,1),replace = TRUE, size = 20),rep(3,20),diag(4), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), runif(20, 0, 1),runif(4, 0, 1))
This function calculates the value of the log-likelihood function
Sim_Loglik( Nlabel, phi, Di, alpha1, delta, lambda, sigma1, beta1, beta2, time, n, zz, tau, lambda1, I, D, cov1, cov2 )Sim_Loglik( Nlabel, phi, Di, alpha1, delta, lambda, sigma1, beta1, beta2, time, n, zz, tau, lambda1, I, D, cov1, cov2 )
Nlabel |
Label for each sample from the area |
phi |
Spatial random effects |
Di |
Euclidean distance between susceptible individual and infectious individual |
alpha1 |
intercept |
delta |
Spatial parameter |
lambda |
a vector containing the length of infectious period |
sigma1 |
precision of spatial random effects |
beta1 |
the parameter corresponding to the covariate associated with susceptible individual |
beta2 |
the parameter corresponding to the covariate associated with area |
time |
time |
n |
Total number of individuals |
zz |
Number of areas |
tau |
the set of infectious individuals at time t in the zth area |
lambda1 |
Spatial dependence |
I |
Identity matrix |
D |
matrix reflecting neighborhood structure |
cov1 |
Individual level covariates |
cov2 |
Area level covariates |
a numeric value for the log-likelihood
Sim_Loglik(rep(1:4,each=5), runif(4,min = 0, max = 1), matrix(runif(400,min=4,max=20),nrow=20,byrow=TRUE),0.4, 2,rep(3,20),0.5,1,1, 10,20,4,sample(c(0,1),replace = TRUE, size = 20),0.6,diag(4), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), runif(20, 0, 1), runif(4, 0, 1))Sim_Loglik(rep(1:4,each=5), runif(4,min = 0, max = 1), matrix(runif(400,min=4,max=20),nrow=20,byrow=TRUE),0.4, 2,rep(3,20),0.5,1,1, 10,20,4,sample(c(0,1),replace = TRUE, size = 20),0.6,diag(4), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), runif(20, 0, 1), runif(4, 0, 1))
This function can use to estimate the model parameters using the initial values.
Simulation_Finalmodel( ITER, zz, lambda0, sigma0, Di, g, nSample, d, n, time, tau, lambda, alpha0, beta10, beta20, cov1, cov2, phi, delta0, Nlabel, D, I )Simulation_Finalmodel( ITER, zz, lambda0, sigma0, Di, g, nSample, d, n, time, tau, lambda, alpha0, beta10, beta20, cov1, cov2, phi, delta0, Nlabel, D, I )
ITER |
Number of iterations |
zz |
Number of Regions |
lambda0 |
initial value for Spatial dependence |
sigma0 |
initial value for the precision of spatial random effects |
Di |
Euclidean distance between susceptible individual and infectious individual |
g |
Number of rows in the lattice |
nSample |
Number of individuals in each cell |
d |
infectious time units |
n |
total number of individuals |
time |
time |
tau |
the set of infectious individuals at time t in the zth area |
lambda |
a vector containing the length of infectious period |
alpha0 |
initial value for the intercept |
beta10 |
initial value for the parameter corresponding to the covariate associated with susceptible individual |
beta20 |
initial value for the parameter corresponding to the area-level covariates corresponding to area |
cov1 |
a vector of covariates associated with susceptible individual |
cov2 |
a vector of area-level covariates corresponding to area |
phi |
Spatial random effects |
delta0 |
Spatial parameter |
Nlabel |
Label for each sample from the area |
D |
matrix reflecting neighborhood structure |
I |
Identity matrix |
the estimated values for the model parameters
Simulation_Finalmodel(2,4,0.2,0.5, matrix(runif(1600,min=4,max=20),nrow=40,byrow=TRUE),2,10,3,40,10, sample(c(0,1),replace=TRUE,size=40),rep(3,40),0.4,1,1,runif(40,0,1), runif(4,0,1),runif(4,min=0,max=1),2,rep(1:4,each=10), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), diag(4))Simulation_Finalmodel(2,4,0.2,0.5, matrix(runif(1600,min=4,max=20),nrow=40,byrow=TRUE),2,10,3,40,10, sample(c(0,1),replace=TRUE,size=40),rep(3,40),0.4,1,1,runif(40,0,1), runif(4,0,1),runif(4,min=0,max=1),2,rep(1:4,each=10), matrix(c(0,-1,0,-1,-1,0,-1,-1,0,-1,0,-1,-1,-1,-1,0),nrow=4,byrow=TRUE), diag(4))
The simulated data for the date diagnosed and tau
TwoWeekTwoWeek
A data frame with 700 rows and 2 columns:
The date which the disease diagnosed
the week
...