-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodel7.stan
More file actions
46 lines (42 loc) · 734 Bytes
/
Copy pathmodel7.stan
File metadata and controls
46 lines (42 loc) · 734 Bytes
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
data{
int<lower=0> N1;
int<lower=0> N2;
int<lower=0> N3;
real<lower=0> Y1[N1];
real<lower=0> Y2[N2];
real<lower=0> Y3[N3];
real<lower=0> ko[N3];
}
parameters{
real mu;
real<lower=0> sig1;
real<lower=0> sig2;
real<lower=0> sig3;
real gum;
real pai;
}
model{
for(i in 1:N1){
Y1[i] ~ normal(mu,sig1);
}
for(i in 1:N2){
Y2[i] ~ normal(mu+gum,sig2);
}
for(i in 1:N3){
Y3[i] ~ normal(mu+(pai*ko[i]),sig3);
}
}
generated quantities{
real predY1[N1];
real predY2[N2];
real predY3[N3];
for(i in 1:N1){
predY1[i] = normal_rng(mu,sig1);
}
for(i in 1:N2){
predY2[i] = normal_rng(mu+gum,sig1);
}
for(i in 1:N3){
predY3[i] = normal_rng(mu+(pai*ko[i]),sig1);
}
}