21
21
array [N_sample] int N; // repertoire size
22
22
array [N_individual] int condition_id; // id of conditions
23
23
array [N_sample] int individual_id; // id of replicate
24
- vector [N_gene] alpha;
25
24
real <lower=0> phi;
26
25
real <lower=0, upper=1> kappa;
27
26
array [N_condition] vector [N_gene] beta_condition;
@@ -31,13 +30,17 @@ data {
31
30
}
32
31
33
32
generated quantities {
33
+ vector [N_gene] alpha;
34
34
array [N_sample] vector <lower=0, upper=1> [N_gene] theta;
35
35
array [N_sample] vector [N_gene] beta_sample;
36
36
array [N_individual] vector [N_gene] beta_individual;
37
-
38
37
// generate usage
39
38
array [N_gene, N_sample] int Y;
40
39
40
+ for(i in 1:N_gene) {
41
+ alpha[i] = normal_rng(-3, 3);
42
+ }
43
+
41
44
for(i in 1:N_individual) {
42
45
for(j in 1:N_gene) {
43
46
beta_individual[i][j] = normal_rng(beta_condition[condition_id[i]][j], sigma_individual[condition_id[i]]);
@@ -88,8 +91,6 @@ N <- rep(x = 1000, times = N_sample)
88
91
89
92
individual_id <- rep(x = 1 : N_individual , each = N_replicates )
90
93
91
- alpha <- rnorm(n = N_gene , mean = - 5 , sd = 3 )
92
-
93
94
phi <- 200
94
95
95
96
kappa <- 0.02
@@ -118,7 +119,6 @@ l <- list(N_sample = N_sample,
118
119
N = N ,
119
120
condition_id = condition_id ,
120
121
individual_id = individual_id ,
121
- alpha = alpha ,
122
122
phi = phi ,
123
123
kappa = kappa ,
124
124
beta_condition = beta_condition ,
@@ -168,7 +168,11 @@ d_zibb_4 <- ysim_df
168
168
save(d_zibb_4 , file = " data/d_zibb_4.RData" , compress = T )
169
169
170
170
171
+ # save(sim, file = "mytests/sim_d_zibb_4.RData", compress = T)
171
172
# ggplot(data = d_zibb_4)+
172
173
# geom_sina(aes(x = gene_name, y = gene_usage_count, col = condition))+
173
174
# theme_bw(base_size = 10)+
174
175
# theme(legend.position = "none")
176
+
177
+ s <- data.frame (summary(sim )$ summary )
178
+ s $ par <- rownames(s )
0 commit comments