-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.R
48 lines (31 loc) · 805 Bytes
/
main.R
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
library(questionr)
library(rstan)
library(rmutil)
library(MASS)
library(reshape2)
library(binom)
library(dplyr)
# Load data and functions ----
source('loadAll.R')
## MCMC ----
source('launch_MCMC.R')
## extract the chains
Chains= rstan::extract(fit)
# Estimate the DIC of the model
source('DIC_stan_model.R')
## posterior distributions of parameters
source('parameter_estimates.R')
# seroprevalence using the classical method
source('ClassicalSeroprevalence.R')
## Figure 1B
source('Figure1.R')
# # Table 4
source('Compare_simulations_observations.R')
C = ComparePosteriorDistObs(data_csv, Chains, regions=1)
V=array(data=0,dim = c(5,5))
for( i in seq(0,4)){
for(j in 1:5){
P=paste(C[2*i+1,j],C[2*i+2,j])
V[i+1,j] =P
}
}