stochastic_marginalestimate: This function helps to perform the marginal estimate for one...

Description Usage Arguments Value Examples

View source: R/stochastic_marginalestimate.R

Description

This function helps to perform the marginal estimate for one country under the global model.

Usage

1

Arguments

theta

parameter

country

is a list include durationtravel : number of days, travel in compartments each day, total_out each day, and x_ini: initial compartments of the country

Value

The realization of the country during the period take into account of travel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
library(CONETTravel)
library(rlist)
data = datas_3travel[[1]][,3:5]
x = c(9999620, 250,130,0,0,0)
P= sum(x)
durationtravel = 84
w21= travelout_3dat[1,1]/(travelout_3dat[1,1] + travelout_3dat[1,3])
w31= travelout_3dat[1,1]/(travelout_3dat[1,1] + travelout_3dat[1,2])
out21 = travelout_3dat[,2]
out31 = travelout_3dat[,3]
total_in = out21*w21 + out31*w31
total_out = travelout_3dat[,1]
country = list(P =P,  total_out= total_out,durationtravel=durationtravel)
populationdynamic = populationdynamicfunc(country)
infect = c(infectfunc(data, x),0)
travelin_compartments = matrix(0,nrow=country$durationtravel,6)
S_in = round(total_in*.97,digits=0)
I_in = round(total_in*.03,digits=0)
travelin_compartments[,1] = S_in
travelin_compartments[,2] = I_in
country =list.append(country,travelin_compartments = travelin_compartments,
populationdynamic=populationdynamic,infect= infect, x_ini = x)
theta = thetas_3travel[[1]][1:6]
stochastic_marginalestimate(theta, country)

## End(Not run)

leminhthien2011/CONETTravel documentation built on April 18, 2021, 4:17 a.m.