Freshdachs / Reaction-Times

0 stars 0 forks source link

Implement Ex-Gauss in Stan with custom functions #3

Open Freshdachs opened 7 years ago

Freshdachs commented 7 years ago

Right now, an ex-gauss fit is missing in stan. Since ex-gauss might not be available in Stan by default, we might have to implement it with custom functions.

lidox commented 7 years ago

We should check that: https://groups.google.com/forum/#!topic/stan-users/xysqXUYt7nY

data {
  int<lower=1> N;
  real RT[N];
}
parameters {
  real<lower=0> mu;

  real<lower=0> sigma;
  real<lower=0> lambda;
}
transformed parameters {
  real<lower = 0> tau;
  tau <- inv(lambda);
}
model {
  // Priors
  mu ~ normal(2000, 1000);

  //
  RT ~ exp_mod_normal(mu, sigma, lambda);
}

http://areshenk-research-notes.com/mixture-modelling-for-reaction-time-distributions/ The downloads section includes Stan and R code for fitting the mixture model to a single participant. It also includes a file for fitting the model to simulated response times with outliers.

Freshdachs commented 7 years ago

Great find! Looks promising!