Sim_Loglik {GDILM.SIR}R Documentation

This function calculates the value of the log-likelihood function

Description

This function calculates the value of the log-likelihood function

Usage

Sim_Loglik(
  Nlabel,
  phi,
  Di,
  alpha1,
  delta,
  lambda,
  sigma1,
  beta1,
  beta2,
  time,
  n,
  zz,
  tau,
  lambda1,
  I,
  D,
  cov1,
  cov2
)

Arguments

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

Value

a numeric value for the log-likelihood

Examples

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))


[Package GDILM.SIR version 1.2.1 Index]