|
1 | 1 | model{
|
2 | 2 | for(s in 1:NSubjects) {
|
3 | 3 | for(t in TrialStart:TrialEnd) {
|
4 |
| - xmu[t,s] <- A[s] * x[t , s] - v[t,s] * B[s] * u[t,s] |
5 |
| - x[t+1,s] ~ dnorm(xmu[t,s], q[s]) |
6 |
| - y[t,s] ~ dnorm(x[t, s], r[s]) |
7 |
| - u[t,s] <- y[t,s] + p[t,s]; |
| 4 | + xmu[t,s] <- A[s] * x[t , s] - v[t,s] * B[s] * e[t,s] # Equation for the aiming angle |
| 5 | + x[t+1,s] ~ dnorm(xmu[t,s], etaprec[s]) # Aiming angle plus noise |
| 6 | + y[t,s] ~ dnorm(x[t, s], epsilonprec[s]) # Equation for the movement angle |
| 7 | + e[t,s] <- y[t,s] + p[t,s] # Equation for movement error |
8 | 8 | }
|
9 |
| - q[s] ~ dgamma(1.0E-3, 1.0E-3) |
10 |
| - r[s] ~ dgamma(1.0E-3, 1.0E-3) |
| 9 | + etaprec[s] ~ dgamma(1.0E-3, 1.0E-3) # Prior distribution for the precision etaprec[s] |
| 10 | + epsilonprec[s] ~ dgamma(1.0E-3, 1.0E-3) # Prior distribution for the precision epsilonprec[s] |
11 | 11 |
|
12 |
| - logit(A[s]) <- A1[s] |
13 |
| - A1[s] ~ dnorm(A1mu, A1prec) |
14 |
| - logit(B[s]) <- B1[s] |
15 |
| - B1[s] ~ dnorm(B1mu, B1prec) |
16 |
| - x[1,s] ~ dnorm(0.0, 1.0E3) |
| 12 | + logit(A[s]) <- A1[s] # Logit of A1 |
| 13 | + A1[s] ~ dnorm(A1mu, A1prec) # Prior distribution for A1[s] |
| 14 | + logit(B[s]) <- B1[s] # Logit of B1 |
| 15 | + B1[s] ~ dnorm(B1mu, B1prec) # Prior distribution for B1[s] |
| 16 | + x[1,s] ~ dnorm(0.0, 1.0E3) # Initialization of the first aiming angle at 0 |
17 | 17 | }
|
18 | 18 |
|
19 |
| - A1mu ~ dnorm(0.0, 1.0E-3) |
20 |
| - A1prec ~ dgamma(1.0E-3, 1.0E-3) |
21 |
| - B1mu ~ dnorm(0.0, 1.0E-3) |
22 |
| - B1prec ~ dgamma(1.0E-3, 1.0E-3) |
| 19 | + A1mu ~ dnorm(0.0, 1.0E-3) # Hyperparameter for the mean of A1 |
| 20 | + A1prec ~ dgamma(1.0E-3, 1.0E-3) # Hyperparameter for the precision of A1 |
| 21 | + B1mu ~ dnorm(0.0, 1.0E-3) # Hyperparameter for the mean of B1 |
| 22 | + B1prec ~ dgamma(1.0E-3, 1.0E-3) # Hyperparameter for the precision of B1 |
23 | 23 | }
|
0 commit comments