5. Traditional model fitting Fitting separate models to each subject Fitting one model to all subjects e.g. DMAT, fast-dm, EZ Ignores similarities Ignores differences Subject 1 ... Subject n P( data 1 | θ 1 ) ... P( data n | θ n ) P( data| θ ) Subject 1 ... Subject n Subject 1 ... Subject n Subject 1 ... Subject n
6. Hierarchical model estimation Subject 1 ... Subject n Group P( θ group |θ 1 , θ. , , θ n ) P(θ 1 |data, θ group ) ... P(θ n |data, θ group )
19. How to get your data into HDDM response, rt, subj_idx, difficulty 1, 1.06, 1, hard 1, 1.052, 1, hard 1, 1.398, 1, hard 0, 0.48, 1, easy 1, 1.798, 1, easy 1, 0.94, 1, easy 1, 2.093, 2, hard 1, 0.91, 2, hard 0, 1.019, 2, hard ...
20. Model specification via configuration file [depends] v = difficulty [mcmc] samples=5000 burn=1000
24. Python model creation import hddm # Load data from csv file into a NumPy structured array data = hddm.load_csv('simple_subj_data.csv') # Create a HDDM model multi object model = hddm.HDDM(data, depends_on={'v':'difficulty'}) # Create model and start MCMC sampling model.sample(5000, burn=2000) # Print fitted parameters and other model statistics model.print_stats() # Plot posterior distributions and theoretical RT distributions hddm.plot_posteriors(model) hddm.plot_post_pred(model)