data{
int<lower=1> N;
int<lower=1> NS;
int<lower=1> NI;
int<lower=1, upper=NS> subject[N]; //subject ID
int<lower=1, upper=NI> item[N]; //item ID
vector[N] cond1; //dummy coded variable
vector[N] cond2; //dummy coded variable
vector<lower=0>[N] rt; //reaction time
vector[3] zero;
}
parameters{
vector[3] beta;
vector[3] u[NS]; //subject random effects
vector[3] w[NI]; //item random effects
vector<lower=0>[3] sigma_u;
vector<lower=0>[3] sigma_w;
corr_matrix[3] omega_u;
corr_matrix[3] omega_w;
real<lower=0> shape;
}
transformed parameters{
cov_matrix[3] Sigma_u;
cov_matrix[3] Sigma_w;
for(r in 1:3){
for(c in 1:3){
Sigma_u[r, c] <- sigma_u[r] * sigma_u[c] * omega_u[r, c];
Sigma_w[r, c] <- sigma_w[r] * sigma_w[c] * omega_w[r, c];
}
}
}
model{
vector<lower=0>[N] scale;
for(j in 1:NS){
u[j] ~ multi_normal(zero, Sigma_u);
}
for(k in 1:NI){
w[k] ~ multi_normal(zero, Sigma_w);
}
sigma_u ~ gamma(1.5, 1.0E-4);
sigma_w ~ gamma(1.5, 1.0E-4);
shape ~ gamma(1, 0.001);
for(i in 1:N){
scale[i] <- exp(-((beta[1] + u[subject[i], 1] + w[item[i], 1]) +
(beta[2] + u[subject[i], 2] + w[item[i], 2])*cond1[i] +
(beta[3] + u[subject[i], 3] + w[item[i], 3])*cond2[i])/shape);
}
rt ~ weibull(shape, scale);
}
@unpublished{FrankEtAl2014,
author = {Stefan L. Frank and Thijs Trompenaars and Shravan Vasishth},
title = {Cross-linguistic differences in processing double-embedded relative clauses: {W}orking-memory constraints or language statistics?},
year = {2014},
note = {submitted},
pdf = {http://www.ling.uni-potsdam.de/~vasishth/pdfs/FrankTrompenaarsVasishthSubmitted.pdf}
}Hi Xiao He,In our research, we use the log-normal in a similar setting; Jeff Rouder suggested to me that this might make more sense generally than the Weibull.
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/zEKVSv6_K70/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.