-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodel9.stan
55 lines (52 loc) · 1.09 KB
/
model9.stan
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
data{
int<lower=0> N1;
int<lower=0> N2;
int<lower=0> N3;
real<lower=0> P1[N1,30];
real<lower=0> P2[N2,30];
real<lower=0> P3[N3,30];
int<lower=0> ko[N3]; //
}
parameters{
real theta_mu;
real<lower=0> theta_sd;
real gum;
real pai;
real performance1[N1];
real performance2[N2];
real performance3[N3];
real<lower=0> sig;
}
transformed parameters{
}
model{
// First period. 1-15 cols
for(j in 1:15){
for(i in 1:N1){
P1[i,j]~normal(performance1[i],sig);
}
for(i in 1:N2){
P2[i,j]~normal(performance2[i],sig);
}
for(i in 1:N3){
P3[i,j]~normal(performance3[i],sig);
}
}
// Second period after 5 mins rest. 16-30 cols
for(j in 16:30){
for(i in 1:N1){
P1[i,j]~normal(performance1[i],sig);
}
for(i in 1:N2){
P2[i,j]~normal(performance2[i]+gum,sig);
}
for(i in 1:N3){
P3[i,j]~normal(performance3[i]+(pai*ko[i]),sig);
}
}
performance1~normal(theta_mu,theta_sd);
performance2~normal(theta_mu,theta_sd);
performance3~normal(theta_mu,theta_sd);
sig~cauchy(0,5);
theta_sd ~ cauchy(0,5);
}