-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00_param_gen.R
82 lines (60 loc) · 2 KB
/
00_param_gen.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
####################################################################################
# This script generates random parameter values from a *reasonable* range
# to investigate our mechanistic models and the joint distribution of our
# summary statistics
####################################################################################
set.seed(2919865)
setwd("/Volumes/SanDisk/Research/JP/HIV/Data/model_parameters")
rho <- w_1 <- w_0 <- sigma <- round(seq(0.001, 1, length = 30), 3)
Sweden_params <- cbind(rho,
sigma,
w_0,
w_1)
write.csv(Sweden_params,
"mapping_Sweden_params_1_csv",
row.names = FALSE)
###############
set.seed(29195)
setwd("/Volumes/SanDisk/Research/JP/HIV/Data/model_parameters")
# The range of possible values is determined using the exponetial distribution and
# data from the original paper. In later scripts, the numbers are hard coded.
# Sampled parameters
r_quant <- function(x, lamda){
log(1-x)/(-1*lamda)
}
# Sampling from the prior
m_sigma <- 1/(292.2/30)
q <- r_quant(.9999, m_sigma)
sigma <- rep(1/runif(30000, 1, q),
23)
m_single <- 1/(163/30)
q <- r_quant(.9999, m_single)
rho <- rep(1/runif(30000, 1, q),
23)
a_1 = 1/36.3
a_0 = 1/23.1
m_sc <- a_1/sqrt(a_0*0.36+ a_1*(1-0.36))
q <- r_quant(.9999, m_sc)
w_1 <- rep(1/runif(30000, 1, q),
23)
m_cc <- a_0/sqrt(a_0*0.36+ a_1*(1-0.36))
q <- r_quant(.9999, m_cc)
w_0 <- rep(1/runif(30000, 1, q),
23)
mu <- rep(rep(0.001, 30000),
23)
g_union <- rep(1, 690000)
lag <- rep(c(-1,
seq(5, 70, by = 5),
seq(80, 150, by = 10)), each = 30000)
Sweden_params <- cbind(mu,
rho,
sigma,
w_0,
w_1,
g_union,
lag)
Sweden_params <- round(Sweden_params, 10)
write.csv(Sweden_params,
"matrix_Sweden_params_19_csv",
row.names = TRUE)