-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
1004 lines (895 loc) · 322 KB
/
index.html
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!-- saved from url=(0031)http://127.0.0.1:7203/index.Rmd -->
<html class="gr__127_0_0_1"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="application/shiny-singletons"></script>
<script type="application/html-dependencies">json2[2014.02.04];jquery[1.12.4];shiny[1.3.2]</script>
<script src="./Reaction time distributions_ an interactive overview_files/json2-min.js.download"></script>
<script src="./Reaction time distributions_ an interactive overview_files/jquery.min.js.download"></script><style>@media print {#ghostery-purple-box {display:none !important}}</style>
<link href="./Reaction time distributions_ an interactive overview_files/shiny.css" rel="stylesheet">
<script src="./Reaction time distributions_ an interactive overview_files/rmd_loader.js.download"></script>
<link href="./Reaction time distributions_ an interactive overview_files/rmd_loader.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/bootstrap.min.css"><script src="./Reaction time distributions_ an interactive overview_files/bootstrap.min.js.download"></script><script src="./Reaction time distributions_ an interactive overview_files/html5shiv.min.js.download"></script><script src="./Reaction time distributions_ an interactive overview_files/respond.min.js.download"></script><script src="./Reaction time distributions_ an interactive overview_files/jquery-ui.min.js.download"></script><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/jquery.tocify.css"><script src="./Reaction time distributions_ an interactive overview_files/jquery.tocify.js.download"></script><script src="./Reaction time distributions_ an interactive overview_files/tabsets.js.download"></script><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/default.css"><script src="./Reaction time distributions_ an interactive overview_files/highlight.js.download"></script><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/selectize.bootstrap3.css"><script src="./Reaction time distributions_ an interactive overview_files/selectize.min.js.download"></script><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/ion.rangeSlider.css"><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/ion.rangeSlider.skinShiny.css"><script src="./Reaction time distributions_ an interactive overview_files/ion.rangeSlider.min.js.download"></script><script src="./Reaction time distributions_ an interactive overview_files/strftime-min.js.download"></script><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/rmd_perf.css"><script src="./Reaction time distributions_ an interactive overview_files/rmd_perf.js.download"></script><meta name="rstudio_origin" content="127.0.0.1:27148"><script src="./Reaction time distributions_ an interactive overview_files/rsiframe.js.download"></script>
<meta name="generator" content="pandoc">
<meta http-equiv="X-UA-Compatible" content="IE=EDGE">
<title>Reaction time distributions: an interactive overview</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
<style type="text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
</style>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
#section-TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#section-TOC {
position: relative;
width: 100%;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
.tocify-subheader {
display: inline;
}
.tocify-subheader .tocify-item {
font-size: 0.95em;
}
</style>
<script type="text/javascript" src="./Reaction time distributions_ an interactive overview_files/MathJax.js.download"></script><style type="text/css">.MathJax_Hover_Frame {border-radius: .25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0px 0px 15px #83A; -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; border: 1px solid #A6D ! important; display: inline-block; position: absolute}
.MathJax_Menu_Button .MathJax_Hover_Arrow {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px; font-family: 'Courier New',Courier; font-size: 9px; color: #F0F0F0}
.MathJax_Menu_Button .MathJax_Hover_Arrow span {display: block; background-color: #AAA; border: 1px solid; border-radius: 3px; line-height: 0; padding: 4px}
.MathJax_Hover_Arrow:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_Hover_Arrow:hover span {background-color: #CCC!important}
</style><style type="text/css">#MathJax_About {position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: #DDDDDD; color: black; cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_About.MathJax_MousePost {outline: none}
.MathJax_Menu {position: absolute; background-color: white; color: black; width: auto; padding: 2px; border: 1px solid #CCCCCC; margin: 0; cursor: default; font: menu; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_MenuItem {padding: 2px 2em; background: transparent}
.MathJax_MenuArrow {position: absolute; right: .5em; padding-top: .25em; color: #666666; font-size: .75em}
.MathJax_MenuActive .MathJax_MenuArrow {color: white}
.MathJax_MenuArrow.RTL {left: .5em; right: auto}
.MathJax_MenuCheck {position: absolute; left: .7em}
.MathJax_MenuCheck.RTL {right: .7em; left: auto}
.MathJax_MenuRadioCheck {position: absolute; left: 1em}
.MathJax_MenuRadioCheck.RTL {right: 1em; left: auto}
.MathJax_MenuLabel {padding: 2px 2em 4px 1.33em; font-style: italic}
.MathJax_MenuRule {border-top: 1px solid #CCCCCC; margin: 4px 1px 0px}
.MathJax_MenuDisabled {color: GrayText}
.MathJax_MenuActive {background-color: Highlight; color: HighlightText}
.MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus {background-color: #E8E8E8}
.MathJax_ContextMenu:focus {outline: none}
.MathJax_ContextMenu .MathJax_MenuItem:focus {outline: none}
#MathJax_AboutClose {top: .2em; right: .2em}
.MathJax_Menu .MathJax_MenuClose {top: -10px; left: -10px}
.MathJax_MenuClose {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; font-family: 'Courier New',Courier; font-size: 24px; color: #F0F0F0}
.MathJax_MenuClose span {display: block; background-color: #AAA; border: 1.5px solid; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; line-height: 0; padding: 8px 0 6px}
.MathJax_MenuClose:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_MenuClose:hover span {background-color: #CCC!important}
.MathJax_MenuClose:hover:focus {outline: none}
</style><style type="text/css">.MathJax_Preview .MJXf-math {color: inherit!important}
</style><style type="text/css">.MJX_Assistive_MathML {position: absolute!important; top: 0; left: 0; clip: rect(1px, 1px, 1px, 1px); padding: 1px 0 0 0!important; border: 0!important; height: 1px!important; width: 1px!important; overflow: hidden!important; display: block!important; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none}
.MJX_Assistive_MathML.MJX_Assistive_MathML_Block {width: 100%!important}
</style><style type="text/css">#MathJax_Zoom {position: absolute; background-color: #F0F0F0; overflow: auto; display: block; z-index: 301; padding: .5em; border: 1px solid black; margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; box-shadow: 5px 5px 15px #AAAAAA; -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_ZoomOverlay {position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
#MathJax_ZoomFrame {position: relative; display: inline-block; height: 0; width: 0}
#MathJax_ZoomEventTrap {position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
</style><style type="text/css">.MathJax_Preview {color: #888}
#MathJax_Message {position: fixed; left: 1em; bottom: 1.5em; background-color: #E6E6E6; border: 1px solid #959595; margin: 0px; padding: 2px 8px; z-index: 102; color: black; font-size: 80%; width: auto; white-space: nowrap}
#MathJax_MSIE_Frame {position: absolute; top: 0; left: 0; width: 0px; z-index: 101; border: 0px; margin: 0px; padding: 0px}
.MathJax_Error {color: #CC0000; font-style: italic}
</style><script charset="utf-8" src="./Reaction time distributions_ an interactive overview_files/button.d941c9a422e2e3faf474b82a1f39e936.js.download"></script><style type="text/css">.MJXp-script {font-size: .8em}
.MJXp-right {-webkit-transform-origin: right; -moz-transform-origin: right; -ms-transform-origin: right; -o-transform-origin: right; transform-origin: right}
.MJXp-bold {font-weight: bold}
.MJXp-italic {font-style: italic}
.MJXp-scr {font-family: MathJax_Script,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-frak {font-family: MathJax_Fraktur,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-sf {font-family: MathJax_SansSerif,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-cal {font-family: MathJax_Caligraphic,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-mono {font-family: MathJax_Typewriter,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-largeop {font-size: 150%}
.MJXp-largeop.MJXp-int {vertical-align: -.2em}
.MJXp-math {display: inline-block; line-height: 1.2; text-indent: 0; font-family: 'Times New Roman',Times,STIXGeneral,serif; white-space: nowrap; border-collapse: collapse}
.MJXp-display {display: block; text-align: center; margin: 1em 0}
.MJXp-math span {display: inline-block}
.MJXp-box {display: block!important; text-align: center}
.MJXp-box:after {content: " "}
.MJXp-rule {display: block!important; margin-top: .1em}
.MJXp-char {display: block!important}
.MJXp-mo {margin: 0 .15em}
.MJXp-mfrac {margin: 0 .125em; vertical-align: .25em}
.MJXp-denom {display: inline-table!important; width: 100%}
.MJXp-denom > * {display: table-row!important}
.MJXp-surd {vertical-align: top}
.MJXp-surd > * {display: block!important}
.MJXp-script-box > * {display: table!important; height: 50%}
.MJXp-script-box > * > * {display: table-cell!important; vertical-align: top}
.MJXp-script-box > *:last-child > * {vertical-align: bottom}
.MJXp-script-box > * > * > * {display: block!important}
.MJXp-mphantom {visibility: hidden}
.MJXp-munderover {display: inline-table!important}
.MJXp-over {display: inline-block!important; text-align: center}
.MJXp-over > * {display: block!important}
.MJXp-munderover > * {display: table-row!important}
.MJXp-mtable {vertical-align: .25em; margin: 0 .125em}
.MJXp-mtable > * {display: inline-table!important; vertical-align: middle}
.MJXp-mtr {display: table-row!important}
.MJXp-mtd {display: table-cell!important; text-align: center; padding: .5em 0 0 .5em}
.MJXp-mtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-mlabeledtr {display: table-row!important}
.MJXp-mlabeledtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mlabeledtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MJXp-scale0 {-webkit-transform: scaleX(.0); -moz-transform: scaleX(.0); -ms-transform: scaleX(.0); -o-transform: scaleX(.0); transform: scaleX(.0)}
.MJXp-scale1 {-webkit-transform: scaleX(.1); -moz-transform: scaleX(.1); -ms-transform: scaleX(.1); -o-transform: scaleX(.1); transform: scaleX(.1)}
.MJXp-scale2 {-webkit-transform: scaleX(.2); -moz-transform: scaleX(.2); -ms-transform: scaleX(.2); -o-transform: scaleX(.2); transform: scaleX(.2)}
.MJXp-scale3 {-webkit-transform: scaleX(.3); -moz-transform: scaleX(.3); -ms-transform: scaleX(.3); -o-transform: scaleX(.3); transform: scaleX(.3)}
.MJXp-scale4 {-webkit-transform: scaleX(.4); -moz-transform: scaleX(.4); -ms-transform: scaleX(.4); -o-transform: scaleX(.4); transform: scaleX(.4)}
.MJXp-scale5 {-webkit-transform: scaleX(.5); -moz-transform: scaleX(.5); -ms-transform: scaleX(.5); -o-transform: scaleX(.5); transform: scaleX(.5)}
.MJXp-scale6 {-webkit-transform: scaleX(.6); -moz-transform: scaleX(.6); -ms-transform: scaleX(.6); -o-transform: scaleX(.6); transform: scaleX(.6)}
.MJXp-scale7 {-webkit-transform: scaleX(.7); -moz-transform: scaleX(.7); -ms-transform: scaleX(.7); -o-transform: scaleX(.7); transform: scaleX(.7)}
.MJXp-scale8 {-webkit-transform: scaleX(.8); -moz-transform: scaleX(.8); -ms-transform: scaleX(.8); -o-transform: scaleX(.8); transform: scaleX(.8)}
.MJXp-scale9 {-webkit-transform: scaleX(.9); -moz-transform: scaleX(.9); -ms-transform: scaleX(.9); -o-transform: scaleX(.9); transform: scaleX(.9)}
.MathJax_PHTML .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style><style type="text/css">.MathJax_Display {text-align: center; margin: 1em 0em; position: relative; display: block!important; text-indent: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; width: 100%}
.MathJax .merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MathJax .MJX-monospace {font-family: monospace}
.MathJax .MJX-sans-serif {font-family: sans-serif}
#MathJax_Tooltip {background-color: InfoBackground; color: InfoText; border: 1px solid black; box-shadow: 2px 2px 5px #AAAAAA; -webkit-box-shadow: 2px 2px 5px #AAAAAA; -moz-box-shadow: 2px 2px 5px #AAAAAA; -khtml-box-shadow: 2px 2px 5px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true'); padding: 3px 4px; z-index: 401; position: absolute; left: 0; top: 0; width: auto; height: auto; display: none}
.MathJax {display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0}
.MathJax:focus, body :focus .MathJax {display: inline-table}
.MathJax img, .MathJax nobr, .MathJax a {border: 0; padding: 0; margin: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; vertical-align: 0; line-height: normal; text-decoration: none}
img.MathJax_strut {border: 0!important; padding: 0!important; margin: 0!important; vertical-align: 0!important}
.MathJax span {display: inline; position: static; border: 0; padding: 0; margin: 0; vertical-align: 0; line-height: normal; text-decoration: none}
.MathJax nobr {white-space: nowrap!important}
.MathJax img {display: inline!important; float: none!important}
.MathJax * {transition: none; -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none}
.MathJax_Processing {visibility: hidden; position: fixed; width: 0; height: 0; overflow: hidden}
.MathJax_Processed {display: none!important}
.MathJax_ExBox {display: block!important; overflow: hidden; width: 1px; height: 60ex; min-height: 0; max-height: none}
.MathJax .MathJax_EmBox {display: block!important; overflow: hidden; width: 1px; height: 60em; min-height: 0; max-height: none}
.MathJax .MathJax_HitBox {cursor: text; background: white; opacity: 0; filter: alpha(opacity=0)}
.MathJax .MathJax_HitBox * {filter: none; opacity: 1; background: transparent}
#MathJax_Tooltip * {filter: none; opacity: 1; background: transparent}
@font-face {font-family: MathJax_Main; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Main-bold; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Main-italic; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Math-italic; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Caligraphic; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Size1; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Size2; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Size3; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf?rev=2.6.1') format('opentype')}
@font-face {font-family: MathJax_Size4; src: url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff?rev=2.6.1') format('woff'), url('http://127.0.0.1:7203/mathjax-local/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf?rev=2.6.1') format('opentype')}
.MathJax .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style></head>
<body data-gr-c-s-loaded="true"><div style="visibility: hidden; overflow: hidden; position: absolute; top: 0px; height: 1px; width: auto; padding: 0px; border: 0px; margin: 0px; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal;"><div id="MathJax_Hidden"></div></div><div id="MathJax_Message" style="display: none;"></div>
<div>
<div data-display-if="!output.__reactivedoc__" data-ns-prefix="" style="display: none;">
<div id="rmd_loader_wrapper">
<div id="rmd_loader" style="">
<p>Please wait...</p>
<img src="./Reaction time distributions_ an interactive overview_files/rmd_loader.gif">
</div>
</div>
</div>
<div id="__reactivedoc__" class="shiny-html-output shiny-bound-output">
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="section-TOC" class="tocify">
<ul id="tocify-header1" class="tocify-header list-group"><li class="tocify-item list-group-item active" data-unique="1_opinion:_three_important_types_of_parameters"><span class="header-section-number">1</span> Opinion: Three important types of parameters</li><ul class="tocify-subheader list-group" data-tag="2"><li class="tocify-item list-group-item" data-unique="11_difficulty"><span class="header-section-number">1.1</span> Difficulty</li><li class="tocify-item list-group-item" data-unique="12_location_onset_and_center"><span class="header-section-number">1.2</span> Location onset and center</li><li class="tocify-item list-group-item" data-unique="13_scale"><span class="header-section-number">1.3</span> Scale</li><li class="tocify-item list-group-item" data-unique="14_which_distribution_is_better"><span class="header-section-number">1.4</span> Which distribution is better?</li></ul></ul><ul id="tocify-header2" class="tocify-header list-group"><li class="tocify-item list-group-item" data-unique="2_select_data"><span class="header-section-number">2</span> Select data</li></ul><ul id="tocify-header3" class="tocify-header list-group"><li class="tocify-item list-group-item" data-unique="3_drag_those_sliders"><span class="header-section-number">3</span> Drag those sliders!</li><ul class="tocify-subheader list-group" data-tag="2"><li class="tocify-item list-group-item" data-unique="31_gaussian_(normal_distribution)"><span class="header-section-number">3.1</span> Gaussian (normal distribution)</li><li class="tocify-item list-group-item" data-unique="32_ex-gaussian"><span class="header-section-number">3.2</span> Ex-gaussian</li><li class="tocify-item list-group-item" data-unique="33_skew_normal"><span class="header-section-number">3.3</span> Skew normal</li><li class="tocify-item list-group-item" data-unique="34_(shifted)_log-normal"><span class="header-section-number">3.4</span> (Shifted) Log-normal</li><li class="tocify-item list-group-item" data-unique="35_(shifted)_inverse_gaussian"><span class="header-section-number">3.5</span> (Shifted) Inverse Gaussian</li><li class="tocify-item list-group-item" data-unique="36_wiener_diffusion"><span class="header-section-number">3.6</span> Wiener diffusion</li><li class="tocify-item list-group-item" data-unique="37_linear_ballistic_accumulator"><span class="header-section-number">3.7</span> Linear Ballistic Accumulator</li><li class="tocify-item list-group-item" data-unique="38_gamma"><span class="header-section-number">3.8</span> Gamma</li><li class="tocify-item list-group-item" data-unique="39_(shifted)_weibull"><span class="header-section-number">3.9</span> (Shifted) Weibull</li></ul></ul><ul id="tocify-header4" class="tocify-header list-group"><li class="tocify-item list-group-item" data-unique="4_applied_code_example"><span class="header-section-number">4</span> Applied code example</li><ul class="tocify-subheader list-group" data-tag="2"><li class="tocify-item list-group-item" data-unique="41_checking_the_fit"><span class="header-section-number">4.1</span> Checking the fit</li><li class="tocify-item list-group-item" data-unique="42_understanding_the_parameter_estimates"><span class="header-section-number">4.2</span> Understanding the parameter estimates</li><li class="tocify-item list-group-item" data-unique="43_priors_and_descriptives"><span class="header-section-number">4.3</span> Priors and descriptives</li></ul></ul><ul id="tocify-header5" class="tocify-header list-group"><li class="tocify-item list-group-item" data-unique="5_notes_on_good_models_for_rt_data"><span class="header-section-number">5</span> Notes on good models for RT data</li></ul></div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="fluid-row" id="section-header">
<h1 class="title toc-ignore">Reaction time distributions: an interactive overview</h1>
</div>
<!--
For everyone looking here: setting up my own shiny server caused major
issues. See more at https://github.com/lindeloev/shiny-rt.
TO DO for later and probably never...
* add brms families for shifted Weibull and shifted Wald. And LBA?
* (Minor) The dataset selector does not update the trims and bin values when these are set in set_data
-->
<!-- Distributions and plotting -->
<!-- Generate datasets -->
<!-- CSS styles -->
<p><link rel="stylesheet" type="text/css" href="./Reaction time distributions_ an interactive overview_files/style.css"></p>
<!-- VIsible meta-data -->
<p>By Jonas Kristoffer Lindeløv (<a href="https://lindeloev.net/">blog</a>, <a href="https://vbn.aau.dk/da/persons/117060">profile</a>).<br> Updated: 23 September, 2019 (<a href="https://github.com/lindeloev/shiny-rt/">source</a>, <a href="https://github.com/lindeloev/shiny-rt/commits/master">changes</a>).</p>
<!-- Social sharing. From simplesharebuttons.com -->
<style type="text/css">
#share-buttons img {
width: 40px;
padding-right: 15px; vertical-align: top;
border: 0;
box-shadow: 0;
display: inline;
vertical-align: top;
}
</style>
<!-- For some reason, the code below ignores this style.
So I've inserted styles manually. Ugly. -->
<div id="section-share-buttons">
<!-- Twitter -->
<script async="" src="./Reaction time distributions_ an interactive overview_files/widgets.js.download" charset="utf-8"></script>
<p><iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" class="twitter-hashtag-button twitter-hashtag-button-rendered twitter-tweet-button" style="position: static; visibility: visible; width: 76px; height: 28px;" title="Twitter Tweet Button" src="./Reaction time distributions_ an interactive overview_files/tweet_button.d6364fae9340b0be5f13818370141fd0.en.html"></iframe> <!-- Facebook --> <a href="http://www.facebook.com/sharer.php?u=https://lindeloev.net/shiny/rt/" target="_blank"><img src="./Reaction time distributions_ an interactive overview_files/facebook.png" style="width: 40px; padding-right: 10px; vertical-align: top;" alt="Facebook"></a> <!-- LinkedIn --> <a href="http://www.linkedin.com/shareArticle?mini=true&url=https://lindeloev.net/shiny/rt/" target="_blank"><img src="./Reaction time distributions_ an interactive overview_files/linkedin.png" style="width: 40px; padding-right: 10px; vertical-align: top;" alt="LinkedIn"></a> <!-- Digg --> <a href="http://www.digg.com/submit?url=https://lindeloev.net/shiny/rt/" target="_blank"><img src="./Reaction time distributions_ an interactive overview_files/diggit.png" style="width: 40px; padding-right: 10px; vertical-align: top;" alt="Digg"></a> <!-- Reddit --> <a href="http://reddit.com/submit?url=https://lindeloev.net/shiny/rt/&title=Reaction%20time%20distributions:%20an%20interactive%20overview" target="_blank"><img src="./Reaction time distributions_ an interactive overview_files/reddit.png" style="width: 40px; padding-right: 10px; vertical-align: top;" alt="Reddit"></a> <!-- Email --> <a href="mailto:?Subject=Reaction%20time%20distributions:%20an%20interactive%20overview&Body=https://lindeloev.net/shiny/rt/"><img src="./Reaction time distributions_ an interactive overview_files/email.png" style="width: 40px; padding-right: 10px; vertical-align: top;" alt="Email"></a></p>
</div>
<p><br></p>
<p style="color: red; font-weight: bold;">OBS: This is the non-interactive version. <a href="http://lindeloev.net/shiny/rt">Click here</a> to go to the interactive version.</p>
<p>All too often, researchers use the normal distribution to model reaction times. Hopefully, this document to lower the burden of shifting to better distributions. Because the normal distribution is so poor for RTs (as you will see), the reward of shifting will be great!</p>
<p>The cheat sheet below gives an overview (get it in <a href="https://github.com/lindeloev/shiny-rt/raw/master/rt_cheat_sheet.png">PNG</a> or <a href="https://github.com/lindeloev/shiny-rt/raw/master/rt_cheat_sheet.pdf">PDF</a>). You can also skip straight to the <a href="http://127.0.0.1:7203/index.Rmd#section-data">interactive part</a> or to the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied code example</a>.</p>
<hr>
<a href="https://github.com/lindeloev/shiny-rt/raw/master/rt_cheat_sheet.pdf"><img src="./Reaction time distributions_ an interactive overview_files/rt_cheat_sheet.png"></a>
<hr>
<div id="section-opinion-three-important-types-of-parameters" class="section level1">
<div name="1_opinion:_three_important_types_of_parameters" data-unique="1_opinion:_three_important_types_of_parameters"></div><h1><span class="header-section-number">1</span> Opinion: Three important types of parameters</h1>
<p>For reaction times, I’ll argue that there are three useful parameters to describe their distribution: Difficulty<a href="http://127.0.0.1:7203/index.Rmd#section-fn1" class="footnote-ref" id="section-fnref1"><sup>1</sup></a>, Onset<a href="http://127.0.0.1:7203/index.Rmd#section-fn2" class="footnote-ref" id="section-fnref2"><sup>2</sup></a>, and Scale.<a href="http://127.0.0.1:7203/index.Rmd#section-fn3" class="footnote-ref" id="section-fnref3"><sup>3</sup></a> In the figure below, the blue curves show the effect of <em>increasing</em> each of these parameters. <a href="http://127.0.0.1:7203/index.Rmd#section-slog">Try manipulating them yourself here</a>.</p>
<p><br></p>
<!-- The image was generated using this code, which is currently disabled using eval=FALSE -->
<p><img src="./Reaction time distributions_ an interactive overview_files/parameter_types.png"></p>
<div id="section-difficulty" class="section level2">
<div name="11_difficulty" data-unique="11_difficulty"></div><h2><span class="header-section-number">1.1</span> Difficulty</h2>
<p>A dominant feature of RTs is that the standard deviation increases approximately linearly with the mean <a href="http://ejwagenmakers.com/2007/WagenmakersBrown2007.pdf">(Wagenmakers et al., 2007)</a>. Reaction times are more dispersed for conditions with longer reaction times (e.g., incongruent trials) and are more condensed for conditions with shorter reaction times (e.g., congruent trials). For interpretability, it is convenient to have one parameter that changes both rather than having to regress on mean and SD separately and always interpret their interaction. Ideally, the value of the difficulty parameter should be somewhere around the <strong>center</strong> (highest density region, e.g., the median RT or the mode RT).</p>
</div>
<div id="section-location-onset-and-center" class="section level2">
<div name="12_location_onset_and_center" data-unique="12_location_onset_and_center"></div><h2><span class="header-section-number">1.2</span> Location onset and center</h2>
<p>Moves the whole distribution towards the left (longer RTs) or right (shorter RTs) without altering its shape.</p>
<ol style="list-style-type: decimal">
<li><strong>Onset:</strong> This is the earliest possible reaction time (for descriptive models where it’s often called <strong>shift</strong>) or the earliest possible start of the decision process (for mechanistic models where it’s called <strong>non-decision time</strong>). In humans, this is often around 200 ms. It’s good to have an onset-parameter since no animal can perceive or respond in 0.0 ms. Models without an onset-parameter often predict positive probabilities of impossibly short RTs.</li>
<li><strong>Center:</strong> Somewhere “in the middle” of the distribution (e.g., <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-1" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-2"><span class="mi" id="MathJax-Span-3" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-1">\mu</script></span> in the normal distribution). I argued above that we should prefer a <strong>difficulty</strong>-like parameter to model the center.</li>
</ol>
</div>
<div id="section-scale" class="section level2">
<div name="13_scale" data-unique="13_scale"></div><h2><span class="header-section-number">1.3</span> Scale</h2>
<p>Stretches or squeezes the distribution over and above <strong>difficulty</strong>, without (severely) changing the <strong>location</strong>. This can be used to tune the distribution to population-specific or experiment-specific characteristics. For example, you would expect wider distributions in patient samples and for dual-tasks.</p>
</div>
<div id="section-which-distribution-is-better" class="section level2">
<div name="14_which_distribution_is_better" data-unique="14_which_distribution_is_better"></div><h2><span class="header-section-number">1.4</span> Which distribution is better?</h2>
<p>It is nice when each parameter does only one thing. If they do several things at once, or if multiple parameters do the <em>same</em> thing, I call them <strong>messy</strong>, because you will need to tune many parameters to achieve one of the above effects. And that’s a mess for interpretability. However, if this behavior at the surface level is justified by an underlying theory that gives meaning to each parameter, I call them <strong>mechanism</strong> parameters.</p>
<p>With this terminology on the table, here are our three commandments:</p>
<blockquote>
<ol style="list-style-type: decimal">
<li>Bad: Distributions with messy parameters.</li>
<li>Good: Distributions with an onset, a difficulty, AND a scale parameter.</li>
<li>Good: Distributions with mechanism parameters.</li>
</ol>
</blockquote>
<p>According to these criteria, <a href="http://127.0.0.1:7203/index.Rmd#section-wiener">DDM</a>, <a href="http://127.0.0.1:7203/index.Rmd#section-lba">LBA</a>, the <a href="http://127.0.0.1:7203/index.Rmd#section-slog">shifted log-normal</a>, and the <a href="http://127.0.0.1:7203/index.Rmd#section-invgauss">inverse Gaussian</a> are the winners on this list. If we also consider how easy it is to interpret the parameter values, I’d say that <a href="http://127.0.0.1:7203/index.Rmd#section-wiener">DDM</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-slog">shifted log-normal</a> come out on top, but this is up for discussion.</p>
</div>
</div>
<div id="section-data" class="section level1">
<div name="2_select_data" data-unique="2_select_data"></div><h1><span class="header-section-number">2</span> Select data</h1>
<p>All of the following datasets are from a single participant in a single condition.</p>
<!--- TESTING --->
<p></p><div class="form-group shiny-input-container" style="width: 100%;">
<label class="control-label" for="rt_type-selectized">Choose a dataset:</label>
<div>
<select id="rt_type" tabindex="-1" class="selectized shiny-bound-input" style="display: none;"><option value="accuracy" selected="selected">Discriminate words/non-words - be accurate (Wagenmakers et al., (2008)</option></select><div class="selectize-control single"><div class="selectize-input items full has-options has-items"><div class="item" data-value="accuracy">Discriminate words/non-words - be accurate (Wagenmakers et al., (2008)</div><input type="text" autocomplete="off" tabindex="" id="rt_type-selectized" style="width: 4px;" class="shiny-bound-input"></div><div class="selectize-dropdown single" style="display: none;"><div class="selectize-dropdown-content"></div></div></div>
<script type="application/json" data-for="rt_type" data-nonempty="">{}</script>
</div>
</div><div class="form-group shiny-input-container" style="width: 100%;">
<label for="rts_input">... or paste your own RTs (separator = space/,/;/tab)):</label>
<input id="rts_input" type="text" class="form-control shiny-bound-input" value="">
</div><div style="display: inline-block;vertical-align:top;">
<div class="form-group shiny-input-container" style="width: 80px;">
<label for="trim_min">Min RT</label>
<input id="trim_min" type="number" class="form-control shiny-bound-input" value="0.18" min="0" max="10" step="0.1">
</div>
</div><div style="display: inline-block;vertical-align:top;">
<div class="form-group shiny-input-container" style="width: 80px;">
<label for="trim_max">Max RT</label>
<input id="trim_max" type="number" class="form-control shiny-bound-input" value="2" min="0" max="10" step="0.1">
</div>
</div><div style="display: inline-block;vertical-align:top;">
<div class="form-group shiny-input-container" style="width: 80px;">
<label for="bins">Bins</label>
<input id="bins" type="number" class="form-control shiny-bound-input" value="70" min="2" max="1000" step="10">
</div>
</div><div id="out4bcdcdaf0d4faefb" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-drag-those-sliders" class="section level1">
<div name="3_drag_those_sliders" data-unique="3_drag_those_sliders"></div><h1><span class="header-section-number">3</span> Drag those sliders!</h1>
<p>Here are some fun challenges:</p>
<ul>
<li><p><strong>One-parameter champ:</strong> For the speed/accuracy and MRT data, try (1) fitting the parameters to one dataset, (2) change the dataset, (3) see how close you can get by <em>only changing one parameter now</em>.</p></li>
<li><p><strong>Fit champ:</strong> There is a special reward if you can fit the data so well that the <a href="https://en.wikipedia.org/wiki/Mean_squared_error">mean squared error (MSE)</a> drops below 40. Use the keyboard arrows to fine-tune parameters. The MSE in the plots is multiplied by 10.000 to give easy-to-read numbers.</p></li>
<li><p><strong>Optimal champ:</strong> Use <a href="https://github.com/paul-buerkner/brms"><code>brms</code></a> to find the optimal fits as shown in the code snippets. The empirical datasets are in the <code>rtdists</code> package. Use <code>library(rtdists')</code>, <code>data('rr98')</code>, and <code>data('speed_acc')</code> to load them. <a href="https://raw.githubusercontent.com/lindeloev/shiny-rt/master/mrt_data.csv" download="">Download the MRT data here</a>. You can also try and use the (frequentist) <a href="https://www.gamlss.com/"><code>gamlss</code> package</a>, though it’s harder to interpret the results.</p></li>
</ul>
<p><br><br></p>
<div id="section-gauss" class="section level2">
<div name="31_gaussian_(normal_distribution)" data-unique="31_gaussian_(normal_distribution)"></div><h2><span class="header-section-number">3.1</span> Gaussian (normal distribution)</h2>
<p>Models responses from a single mean with a symmetrical dispersion towards faster and slower RTs. In most cases, the normal distribution is the worst distribution to fit reaction times. For example, for typical reaction times, your fitted model will predict that more than 5% of the reaction times will be <em>faster</em> than the fastest RT ever recorded!</p>
<p>Yet, the Gaussian is by far the most frequently used analysis of reaction times because it is the default in most statistical tests, packages, and software. For example, t-tests, ANOVA, linear regression, <code>lm</code>, <code>lme4::lmer</code>, and <code>brms::brm</code>. Also, if your pre-processing includes computing means for each participant or condition and you use <em>those</em> means as data, you’ve subscribed to the Gaussian model (and thrown away a lot of wonderful data).</p>
<p><strong>Parameters</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-4" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-5"><span class="mi" id="MathJax-Span-6" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-2">\mu</script></span> (<strong>center</strong>): the mean. It is heavily affected by the tail.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-7" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-8"><span class="mi" id="MathJax-Span-9" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-3">\sigma</script></span> (<strong>scale</strong>): the standard deviation. This models (symmetric) variability in RTs.</li>
</ul>
<p>It is easy to infer these parameters from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-10" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-11"><span class="mi" id="MathJax-Span-12" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-4">\mu</script></span> by <code>condition</code>. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-5-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-13" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-14"><span class="mi" id="MathJax-Span-15" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-5">\sigma</script></span> is fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=gaussian())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-0 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>μ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>μ</i> = 3</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 27.3869%;"><i>μ</i> = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.3</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.9</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.77387%;">1.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">2.1</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">2.4</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">2.7</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">3</span></span><span class="irs-bar" style="left: 5.52764%; width: 29.6482%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 29.6482%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="gauss_mu" data-min="0" data-max="3" data-from="1" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&mu;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-1 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>σ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>σ</i> = 1.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 19.196%;"><i>σ</i> = 0.4</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -6.03015%;">0.15</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.3</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -5.77889%;">0.45</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.6</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: hidden; margin-left: -6.03015%;">0.75</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">0.9</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -6.03015%;">1.05</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: hidden; margin-left: -5.77889%;">1.35</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.52261%;">1.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 23.7186%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 23.7186%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="gauss_sigma" data-min="0" data-max="1.5" data-from="0.4" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&sigma;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="out7897639d9acab083" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-exgauss" class="section level2">
<div name="32_ex-gaussian" data-unique="32_ex-gaussian"></div><h2><span class="header-section-number">3.2</span> Ex-gaussian</h2>
<p>If you believe that responses were caused by a mix of two independent processes, (1) a <a href="http://127.0.0.1:7203/index.Rmd#section-gauss">Gaussian</a> and (2) a decaying exponential, the ex-gaussian is exactly this. Most people don’t believe this but they use the ex-gaussian in a purely descriptive way because it usually has an excellent fit to RTs. See <a href="https://en.wikipedia.org/wiki/Exponentially_modified_Gaussian_distribution">Wikipedia</a>.</p>
<p><strong>Parameters:</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-6-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-16" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-17"><span class="mi" id="MathJax-Span-18" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-6">\mu</script></span> (<strong>center</strong>): the mean of the gaussian. This models shorter/longer mean RTs.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-7-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-19" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-20"><span class="mi" id="MathJax-Span-21" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-7">\sigma</script></span> (<strong>scale</strong>): the standard deviation of the gaussian. It models symmetrical variability around <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-8-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-22" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-23"><span class="mi" id="MathJax-Span-24" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-8">\mu</script></span>.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-9-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-25" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-26"><span class="mi" id="MathJax-Span-27" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-9">\lambda</script></span> (<strong>messy</strong>): the decay rate of the exponential. This models the tail of long RTs. Higher <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-10-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-28" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-29"><span class="mi" id="MathJax-Span-30" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-10">\lambda</script></span> –> more tail dominance over the Gaussian.</li>
</ul>
<p>It is easy to infer these parameters from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-11-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-31" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-32"><span class="mi" id="MathJax-Span-33" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-11">\mu</script></span> by <code>condition</code>. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-12-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-34" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-35"><span class="mi" id="MathJax-Span-36" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-12">\sigma</script></span> and <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-13-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-37" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-38"><span class="mi" id="MathJax-Span-39" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-13">\lambda</script></span> are fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=exgaussian())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-2 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>μ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>μ</i> = 3</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 27.3869%;"><i>μ</i> = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.3</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.9</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.77387%;">1.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">2.1</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">2.4</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">2.7</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">3</span></span><span class="irs-bar" style="left: 5.52764%; width: 29.6482%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 29.6482%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="exgauss_mu" data-min="0" data-max="3" data-from="1" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&mu;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-3 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>σ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>σ</i> = 1</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 7.31156%;"><i>σ</i> = 0.15</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.1</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.3</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.77387%;">0.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">0.7</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">0.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">0.9</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">1</span></span><span class="irs-bar" style="left: 5.52764%; width: 13.3417%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 13.3417%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="exgauss_sigma" data-min="0" data-max="1" data-from="0.15" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&sigma;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-4 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>λ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>λ</i> = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 8.8191%;"><i>λ</i> = 0.3</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">0.8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">1.6</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 13.3417%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 13.3417%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="exgauss_lambda" data-min="0" data-max="2" data-from="0.3" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&lambda;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="outde19d46389f3e0af" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-skew" class="section level2">
<div name="33_skew_normal" data-unique="33_skew_normal"></div><h2><span class="header-section-number">3.3</span> Skew normal</h2>
<p>Adds a skew to the normal (Gaussian) distribution via an extra skew-parameter. In my experience, it usually has a poorer fit to reaction times, though it is superior to the Gaussian.</p>
<p><strong>Parameters:</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-14-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-40" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-41"><span class="mi" id="MathJax-Span-42" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-14">\mu</script></span> (<strong>center</strong>): the mean.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-15-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-43" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-44"><span class="mi" id="MathJax-Span-45" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-15">\sigma</script></span> (<strong>scale</strong>): the standard deviation. Changing <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-16-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-46" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-47"><span class="mi" id="MathJax-Span-48" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-16">\sigma</script></span> preserves the mean <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-17-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-49" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-50"><span class="mi" id="MathJax-Span-51" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-17">\mu</script></span> but not the median. Note that when <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-18-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi><mo>&#x2260;</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-52" role="math" style="width: 2.993em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.502em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.45em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-53"><span class="mi" id="MathJax-Span-54" style="font-family: MathJax_Math-italic;">α</span><span class="mo" id="MathJax-Span-55" style="font-family: MathJax_Main; padding-left: 0.297em;">≠</span><span class="mn" id="MathJax-Span-56" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi><mo>≠</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-18">\alpha \neq 0</script></span>, the distribution is not symmetric, so don’t interpret it as the SD of a normal distribution.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-19-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-57" role="math" style="width: 0.787em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.64em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-58"><span class="mi" id="MathJax-Span-59" style="font-family: MathJax_Math-italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-19">\alpha</script></span> (<strong>messy</strong>): the skewness. When <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-20-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi><mo>=</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-60" role="math" style="width: 2.993em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.502em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1002.45em, 2.306em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-61"><span class="mi" id="MathJax-Span-62" style="font-family: MathJax_Math-italic;">α</span><span class="mo" id="MathJax-Span-63" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-64" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-20">\alpha = 0</script></span>, it’s a Gaussian.</li>
</ul>
<p>It is easy to infer these parameters from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-21-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-65" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-66"><span class="mi" id="MathJax-Span-67" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-21">\mu</script></span> by <code>condition</code>. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-22-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-68" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-69"><span class="mi" id="MathJax-Span-70" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-22">\sigma</script></span> and <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-23-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-71" role="math" style="width: 0.787em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.64em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-72"><span class="mi" id="MathJax-Span-73" style="font-family: MathJax_Math-italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-23">\alpha</script></span> are fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=skew_normal())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-5 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>μ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>μ</i> = 3</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 27.6382%;"><i>μ</i> = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.3</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.9</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">1.2</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.77387%;">1.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">1.8</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">2.1</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">2.4</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">2.7</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">3</span></span><span class="irs-bar" style="left: 5.52764%; width: 29.6482%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 29.6482%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="skew_mu" data-min="0" data-max="3" data-from="1" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&mu;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-6 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>σ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>σ</i> = 1.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 13.0151%;"><i>σ</i> = 0.3</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -5.77889%;">0.15</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">0.3</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -6.03015%;">0.45</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: hidden; margin-left: -5.77889%;">0.75</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">0.9</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -6.03015%;">1.05</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: hidden; margin-left: -6.03015%;">1.35</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.77387%;">1.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 17.7889%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 17.7889%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="skew_sigma" data-min="0" data-max="1.5" data-from="0.3" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&sigma;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-7 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>α</i> = -15</span><span class="irs-max" style="visibility: visible;"><i>α</i> = 15</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 50.3266%;"><i>α</i> = 3.5</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -4.77387%;">-15</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">-12</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -3.51759%;">-9</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -3.51759%;">-6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -3.51759%;">-3</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -2.76382%;">6</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">9</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.0201%;">12</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">15</span></span><span class="irs-bar" style="left: 5.52764%; width: 54.8492%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 54.8492%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="skew_alpha" data-min="-15" data-max="15" data-from="3.5" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&alpha;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="out7201476cceb6cb4e" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-slog" class="section level2">
<div name="34_(shifted)_log-normal" data-unique="34_(shifted)_log-normal"></div><h2><span class="header-section-number">3.4</span> (Shifted) Log-normal</h2>
<p>When using logarithms, you model <em>percentage increase or decrease</em> instead of absolute differences. That is, rather than saying “RTs are 40 ms slower in incongruent trials”, your parameter(s) say that “RTs are 7% slower in incongruent trials”. This embodies the intuition that a difference of 40 ms can be huge for simple reaction times but insignificant for RTs around 10 seconds. Mathematically it is about <em>multiplicative</em> relationships rather than <em>additive</em> relationships, and this makes some sense when talking about RTs, so I’d say that the shifted log-normal is somewhere between being descriptive and mechanistic. In general, log-like models <a href="https://statmodeling.stat.columbia.edu/2019/08/21/you-should-usually-log-transform-your-positive-data/">makes a lot of sense for most positive-only variables</a> like RT.</p>
<p>It’s called “log-normal” because the parameters are the mean and sd of the log-transformed RTs, which is assumed to be a normal (Gaussian) distribution. For example, for simple RTs you will often see an intercept near <code>exp(-1.5) = 0.22 seconds</code>.</p>
<p><strong>Parameters:</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-24-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-74" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-75"><span class="mi" id="MathJax-Span-76" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-24">\mu</script></span> (<strong>difficulty</strong>): the mean of the log-normal distribution. The mean of <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-25-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-77" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-78"><span class="mi" id="MathJax-Span-79" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-25">\mu</script></span> represents the median RT. The median RT is then <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-26-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mi>&#x03BC;</mi><mo stretchy="false">)</mo></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-80" role="math" style="width: 7.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.473em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1006.38em, 2.551em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-81"><span class="mi" id="MathJax-Span-82" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-83" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-84" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-85" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-86" style="font-family: MathJax_Math-italic;">t</span><span class="mo" id="MathJax-Span-87" style="font-family: MathJax_Main; padding-left: 0.248em;">+</span><span class="mi" id="MathJax-Span-88" style="font-family: MathJax_Math-italic; padding-left: 0.248em;">e</span><span class="mi" id="MathJax-Span-89" style="font-family: MathJax_Math-italic;">x</span><span class="mi" id="MathJax-Span-90" style="font-family: MathJax_Math-italic;">p</span><span class="mo" id="MathJax-Span-91" style="font-family: MathJax_Main;">(</span><span class="mi" id="MathJax-Span-92" style="font-family: MathJax_Math-italic;">μ</span><span class="mo" id="MathJax-Span-93" style="font-family: MathJax_Main;">)</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.35em; border-left: 0px solid; width: 0px; height: 1.297em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mi>μ</mi><mo stretchy="false">)</mo></math></span></span><script type="math/tex" id="MathJax-Element-26">shift + exp(\mu)</script></span>.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-27-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-94" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-95"><span class="mi" id="MathJax-Span-96" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-27">\sigma</script></span> (<strong>scale</strong>): the standard deviation of the log-normal distribution. Increases the mean but not the median of <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-28-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-97" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-98"><span class="mi" id="MathJax-Span-99" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-28">\mu</script></span>.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-29-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-100" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-101"><span class="mi" id="MathJax-Span-102" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-103" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-104" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-105" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-106" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-29">shift</script></span> (<strong>shift</strong>): time of the earliest possible response. When <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-30-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-107" role="math" style="width: 5.002em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.169em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1004.12em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-108"><span class="mi" id="MathJax-Span-109" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-110" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-111" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-112" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-113" style="font-family: MathJax_Math-italic;">t</span><span class="mo" id="MathJax-Span-114" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-115" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-30">shift = 0</script></span>, it’s a straight-up <em>log-normal distribution</em> with two parameters.</li>
</ul>
<p>It is easy to infer these parameters from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-31-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-116" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-117"><span class="mi" id="MathJax-Span-118" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-31">\mu</script></span> by <code>condition</code>. It is log, so use <code>exp()</code> to back-transform. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-32-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-119" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-120"><span class="mi" id="MathJax-Span-121" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-32">\sigma</script></span> and <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-33-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-122" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-123"><span class="mi" id="MathJax-Span-124" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-125" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-126" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-127" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-128" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-33">shift</script></span> are fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=shifted_lognormal())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-8 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>μ</i> = -2</span><span class="irs-max" style="visibility: visible;"><i>μ</i> = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 25.603%;"><i>μ</i> = -0.6</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -3.51759%;">-2</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -5.27638%;">-1.6</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -5.52764%;">-1.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -5.52764%;">-0.8</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -5.52764%;">-0.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">0.8</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.6</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 31.1307%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 31.1307%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="slog_mu" data-min="-2" data-max="2" data-from="-0.6" data-step="0.05" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&mu;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-9 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>σ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>σ</i> = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 21.9095%;"><i>σ</i> = 0.6</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.6</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 26.6834%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 26.6834%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="slog_sigma" data-min="0" data-max="2" data-from="0.6" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&sigma;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-10 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">shift = 0</span><span class="irs-max" style="visibility: visible;">shift = 1.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: -5.77889%;">shift = 0</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -5.77889%;">0.15</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.3</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -5.77889%;">0.45</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: hidden; margin-left: -6.03015%;">0.75</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">0.9</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -5.77889%;">1.05</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">1.2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: hidden; margin-left: -6.03015%;">1.35</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.52261%;">1.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 0%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 0%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="slog_shift" data-min="0" data-max="1.5" data-from="0" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="shift = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="out9cb71056b86b8a13" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-invgauss" class="section level2">
<div name="35_(shifted)_inverse_gaussian" data-unique="35_(shifted)_inverse_gaussian"></div><h2><span class="header-section-number">3.5</span> (Shifted) Inverse Gaussian</h2>
<p>… also known as the <em>(Shifted) Wald</em>. It is not as “inverse” of the Gaussian as it sounds. It is closely related to the <a href="http://127.0.0.1:7203/index.Rmd#section-wiener">Weiener / Decision Diffusion model</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-lba">LBA model</a> in the following way (quote from <a href="http://127.0.0.1:7203/Wikipedia%5D(https://en.wikipedia.org/wiki/Inverse_Gaussian_distribution)">Wikipedia</a>:</p>
<blockquote>
<p>The name can be misleading: it is an “inverse” only in that, while the Gaussian describes a Brownian motion’s level at a fixed time, the inverse Gaussian describes the distribution of the time a Brownian motion with positive drift takes to reach a fixed positive level.</p>
</blockquote>
<p>In other words, if you have time on the x-axis and start a lot of walkers at <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-34-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>0</mn></msub><mo>=</mo><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-129" role="math" style="width: 5.346em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.463em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1004.41em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-130"><span class="msubsup" id="MathJax-Span-131"><span style="display: inline-block; position: relative; width: 0.787em; height: 0px;"><span style="position: absolute; clip: rect(3.238em, 1000.35em, 4.169em, -999.998em); top: -4.017em; left: 0.002em;"><span class="mi" id="MathJax-Span-132" style="font-family: MathJax_Math-italic;">t</span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="position: absolute; top: -3.87em; left: 0.346em;"><span class="mn" id="MathJax-Span-133" style="font-size: 70.7%; font-family: MathJax_Main;">0</span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span></span></span><span class="mo" id="MathJax-Span-134" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mi" id="MathJax-Span-135" style="font-family: MathJax_Math-italic; padding-left: 0.297em;">s</span><span class="mi" id="MathJax-Span-136" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-137" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-138" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-139" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mn>0</mn></msub><mo>=</mo><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-34">t_0 = shift</script></span>, the Gaussian describes the distribution of their vertical location at a fixed time (<code>t_i</code>) while the inverse Gaussian describes the distribution of times when they cross a certain threshold on the y-axis. Like Wiener and LBA, the inverse Gaussian can be thought of as modeling a decision process, without incorporating the correctness of the response.</p>
<p><strong>Parameters:</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-35-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-140" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-141"><span class="mi" id="MathJax-Span-142" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-35">\mu</script></span> (<strong>difficulty</strong>): The mean. Notice that this will be heavily influenced by long RTs.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-36-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-143" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-144"><span class="mi" id="MathJax-Span-145" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-36">\lambda</script></span> (<strong>scale</strong>): Decreases the variance but is harder to intepret since <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-37-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi><mo>=</mo><msqrt><mo stretchy="false">(</mo><msup><mi>&#x03BC;</mi><mn>3</mn></msup><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>&#x03BB;</mi><mo stretchy="false">)</mo></msqrt></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-146" role="math" style="width: 7.061em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.885em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.13em, 1005.88em, 2.65em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-147"><span class="mi" id="MathJax-Span-148" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span class="mo" id="MathJax-Span-149" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="msqrt" id="MathJax-Span-150" style="padding-left: 0.297em;"><span style="display: inline-block; position: relative; width: 3.924em; height: 0px;"><span style="position: absolute; clip: rect(3.14em, 1002.8em, 4.414em, -999.998em); top: -4.017em; left: 0.983em;"><span class="mrow" id="MathJax-Span-151"><span class="mo" id="MathJax-Span-152" style="font-family: MathJax_Main;">(</span><span class="msubsup" id="MathJax-Span-153"><span style="display: inline-block; position: relative; width: 1.032em; height: 0px;"><span style="position: absolute; clip: rect(3.434em, 1000.59em, 4.365em, -999.998em); top: -4.017em; left: 0.002em;"><span class="mi" id="MathJax-Span-154" style="font-family: MathJax_Math-italic;">μ</span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="position: absolute; top: -4.311em; left: 0.591em;"><span class="mn" id="MathJax-Span-155" style="font-size: 70.7%; font-family: MathJax_Main;">3</span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span></span></span><span class="texatom" id="MathJax-Span-156"><span class="mrow" id="MathJax-Span-157"><span class="mo" id="MathJax-Span-158" style="font-family: MathJax_Main;">/</span></span></span><span class="mi" id="MathJax-Span-159" style="font-family: MathJax_Math-italic;">λ</span><span class="mo" id="MathJax-Span-160" style="font-family: MathJax_Main;">)</span></span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="position: absolute; clip: rect(3.581em, 1002.94em, 3.924em, -999.998em); top: -4.605em; left: 0.983em;"><span style="display: inline-block; position: relative; width: 2.944em; height: 0px;"><span style="position: absolute; font-family: MathJax_Main; top: -4.017em; left: -0.096em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="position: absolute; font-family: MathJax_Main; top: -4.017em; left: 2.208em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="font-family: MathJax_Main; position: absolute; top: -4.017em; left: 0.346em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="font-family: MathJax_Main; position: absolute; top: -4.017em; left: 0.836em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="font-family: MathJax_Main; position: absolute; top: -4.017em; left: 1.277em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="font-family: MathJax_Main; position: absolute; top: -4.017em; left: 1.767em;">−<span style="display: inline-block; width: 0px; height: 4.022em;"></span></span></span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span><span style="position: absolute; clip: rect(3.042em, 1001.03em, 4.512em, -999.998em); top: -4.017em; left: 0.002em;"><span style="font-family: MathJax_Size1;">√</span><span style="display: inline-block; width: 0px; height: 4.022em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.468em; border-left: 0px solid; width: 0px; height: 1.532em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi><mo>=</mo><msqrt><mo stretchy="false">(</mo><msup><mi>μ</mi><mn>3</mn></msup><mrow class="MJX-TeXAtom-ORD"><mo>/</mo></mrow><mi>λ</mi><mo stretchy="false">)</mo></msqrt></math></span></span><script type="math/tex" id="MathJax-Element-37">\sigma = \sqrt{(\mu^3/\lambda)}</script></span>.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-38-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-161" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-162"><span class="mi" id="MathJax-Span-163" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-164" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-165" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-166" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-167" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-38">shift</script></span> (<strong>onset</strong>): time of earliest possible response. When <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-39-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-168" role="math" style="width: 5.002em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.169em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1004.12em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-169"><span class="mi" id="MathJax-Span-170" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-171" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-172" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-173" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-174" style="font-family: MathJax_Math-italic;">t</span><span class="mo" id="MathJax-Span-175" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-176" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-39">shift = 0</script></span> it is a plain <em>Inverse Gaussian</em> or <em>Wald</em> distribution, i.e., only two parameters.</li>
</ul>
<p>It is easy to infer the parameters of the (non-shifted) inverse Gaussian / Wald. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-40-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-177" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-178"><span class="mi" id="MathJax-Span-179" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-40">\mu</script></span> by <code>condition</code>. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-41-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-180" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-181"><span class="mi" id="MathJax-Span-182" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-41">\lambda</script></span> is fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=inverse.gaussian())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-11 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>μ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>μ</i> = 2.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 23.9397%;"><i>μ</i> = 0.8</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -5.77889%;">0.25</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">0.5</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -6.03015%;">0.75</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -5.77889%;">1.25</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">1.5</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -6.03015%;">1.75</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -5.77889%;">2.25</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.77387%;">2.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 28.4623%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 28.4623%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sinvgauss_mu" data-min="0" data-max="2.5" data-from="0.8" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&mu;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-12 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>λ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>λ</i> = 20</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 15.7789%;"><i>λ</i> = 4</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -2.76382%;">4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -2.76382%;">6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.0201%;">10</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.0201%;">12</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.0201%;">14</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.0201%;">16</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.0201%;">18</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">20</span></span><span class="irs-bar" style="left: 5.52764%; width: 17.7889%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 17.7889%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sinvgauss_lambda" data-min="0" data-max="20" data-from="4" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&lambda;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-13 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">shift = 0</span><span class="irs-max" style="visibility: visible;">shift = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: -5.77889%;">shift = 0</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.6</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 0%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 0%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sinvgauss_shift" data-min="0" data-max="2" data-from="0" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="shift = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="out69e1123467ec1d04" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-wiener" class="section level2">
<div name="36_wiener_diffusion" data-unique="36_wiener_diffusion"></div><h2><span class="header-section-number">3.6</span> Wiener diffusion</h2>
<p>Also called the <em>Diffusion Decision Model (DDM)</em>, this is probably the most popular model focused at <em>mechanisms</em>. It applies to two-alternative forced-choice (2afc) scenarios and requires data on <em>accuracy</em> as well (scored as correct/wrong). It models RTs as a decision being made when a random walker crosses one of two thresholds (boundary). It’s clear mechanistic interpretability is a strength, but it requires some effort to understand and do. Read <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2474742/">Ratcliff & McKoon (2008)</a> for a motivation for the model. I like <a href="https://images.app.goo.gl/b31JzswrSQK1f5zf8">this visalization</a>.</p>
<p>The diffusion idea also underlies the <a href="http://127.0.0.1:7203/index.Rmd#section-invgauss">inverse Gaussian</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-lba">LBA model</a>.</p>
<p><strong>Parameters:</strong></p>
<p>All of these are mechanism-like</p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-42-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-183" role="math" style="width: 0.787em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.64em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-184"><span class="mi" id="MathJax-Span-185" style="font-family: MathJax_Math-italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-42">\alpha</script></span> (<strong>difficulty</strong>): Boundary separation. The distance between thresholds. Longer distance –> more varied paths –> dispersed RTs.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-43-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C4;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-186" role="math" style="width: 0.64em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.542em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-187"><span class="mi" id="MathJax-Span-188" style="font-family: MathJax_Math-italic;">τ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.1em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>τ</mi></math></span></span><script type="math/tex" id="MathJax-Element-43">\tau</script></span> (<strong>onset</strong>): Non-decision time (ndt). The time at which the random walker starts.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-44-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B2;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-189" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-190"><span class="mi" id="MathJax-Span-191" style="font-family: MathJax_Math-italic;">β<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.179em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>β</mi></math></span></span><script type="math/tex" id="MathJax-Element-44">\beta</script></span> (<strong>difficulty</strong>): Bias. How close the walker starts to the upper threshold (<span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-45-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B2;</mi><mo>=</mo><mn>0.5</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-192" role="math" style="width: 3.875em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.238em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1003.19em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-193"><span class="mi" id="MathJax-Span-194" style="font-family: MathJax_Math-italic;">β<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span class="mo" id="MathJax-Span-195" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-196" style="font-family: MathJax_Main; padding-left: 0.297em;">0.5</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.179em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>β</mi><mo>=</mo><mn>0.5</mn></math></span></span><script type="math/tex" id="MathJax-Element-45">\beta = 0.5</script></span> is in the middle). Higher = closer = faster and more condensed RTs.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-46-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B4;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-197" role="math" style="width: 0.542em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.444em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.228em, 1000.44em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-198"><span class="mi" id="MathJax-Span-199" style="font-family: MathJax_Math-italic;">δ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>δ</mi></math></span></span><script type="math/tex" id="MathJax-Element-46">\delta</script></span> (<strong>difficulty</strong>): Drift Rate. The speed of the walker. Higher –> faster and more condensed RTs.</li>
</ul>
<p>See <a href="http://singmann.org/wiener-model-analysis-with-brms-part-i/">this three-part brms tutorial</a> by Henrik Singman on how to fit it using <code>brms::brm</code> and do regression on these parameters. It usually takes days or weeks to fit, but <a href="https://www.ejwagenmakers.com/2007/EZ.pdf">Wagenmakers (2007)</a> made the <a href="https://www.ejwagenmakers.com/EZ.html">EZ diffusion calculator</a> which approximates the parameters in the simplest scenario. The <a href="http://ski.clps.brown.edu/hddm_docs/">HDDM python package</a> can do it as well.</p>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<label class="control-label" for="wiener_alpha">Boundary separation</label>
<span class="irs js-irs-14 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>α</i> = 0.5</span><span class="irs-max" style="visibility: visible;"><i>α</i> = 3.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 24.8744%;"><i>α</i> = 1.5</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -4.77387%;">0.5</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.8</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">1.1</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">1.7</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">2.3</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">2.6</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">2.9</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">3.2</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.52261%;">3.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 29.6482%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 29.6482%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="wiener_alpha" data-min="0.5" data-max="3.5" data-from="1.5" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&alpha;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<label class="control-label" for="wiener_tau">Non-decision time</label>
<span class="irs js-irs-15 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>τ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>τ</i> = 1</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 31.5578%;"><i>τ</i> = 0.4</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.1</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">0.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">0.3</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.52261%;">0.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">0.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">0.7</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">0.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">0.9</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">1</span></span><span class="irs-bar" style="left: 5.52764%; width: 35.5779%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 35.5779%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="wiener_tau" data-min="0" data-max="1" data-from="0.4" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&tau;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<label class="control-label" for="wiener_beta">Bias</label>
<span class="irs js-irs-16 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>β</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>β</i> = 1</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 21.9095%;"><i>β</i> = 0.3</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.1</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">0.3</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.52261%;">0.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">0.7</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">0.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">0.9</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">1</span></span><span class="irs-bar" style="left: 5.52764%; width: 26.6834%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 26.6834%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="wiener_beta" data-min="0" data-max="1" data-from="0.3" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&beta;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<label class="control-label" for="wiener_delta">Drift rate</label>
<span class="irs js-irs-17 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;"><i>δ</i> = -1</span><span class="irs-max" style="visibility: visible;"><i>δ</i> = 4</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 39.9497%;"><i>δ</i> = 1.5</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -3.51759%;">-1</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -5.27638%;">-0.5</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.5</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.52261%;">1.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">2.5</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">3.5</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">4</span></span><span class="irs-bar" style="left: 5.52764%; width: 44.4724%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 44.4724%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="wiener_delta" data-min="-1" data-max="4" data-from="1.5" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&delta;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="outdb2a4164e3035101" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-lba" class="section level2">
<div name="37_linear_ballistic_accumulator" data-unique="37_linear_ballistic_accumulator"></div><h2><span class="header-section-number">3.7</span> Linear Ballistic Accumulator</h2>
<p>This model has some resemblance to the <a href="http://127.0.0.1:7203/index.Rmd#section-wiener">Wiener diffusion model</a> in that it models latent “movements” towards decision thresholds, and is very much focused on <em>mechanisms</em>. It likewise applies to two-alternative forced-choice (2afc) scenarios, requiring data on accuracy as well (correct/incorrect response). Although it involves a lot of parameters, the model itself is (at least supposed to be) simpler than the diffusion model <a href="https://linkinghub.elsevier.com/retrieve/pii/S0010-0285(07)00072-2">as explained in Brown & Heathcote (2008)</a>. A nice visualization from that paper <a href="https://www.semanticscholar.org/paper/The-simplest-complete-model-of-choice-response-Brown-Heathcote/6a23d45269edd7783fa6edd8c469ca8fb5d53ac6/figure/4">escaped the paywall here</a>.</p>
<p><strong>Parameters:</strong></p>
<p>All of these are mechanism-like:</p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-47-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-200" role="math" style="width: 0.885em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.738em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.228em, 1000.74em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-201"><span class="mi" id="MathJax-Span-202" style="font-family: MathJax_Math-italic;">A</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi></math></span></span><script type="math/tex" id="MathJax-Element-47">A</script></span>: upper bound of the starting point. The starting point is modeled as randomly drawn in this interval.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-48-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-203" role="math" style="width: 0.542em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.444em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.44em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-204"><span class="mi" id="MathJax-Span-205" style="font-family: MathJax_Math-italic;">b</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi></math></span></span><script type="math/tex" id="MathJax-Element-48">b</script></span> (<strong>difficulty</strong>): response threshold (usually, <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-49-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi><mo>&gt;</mo><mi>A</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-206" role="math" style="width: 3.091em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.551em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.55em, 2.355em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-207"><span class="mi" id="MathJax-Span-208" style="font-family: MathJax_Math-italic;">b</span><span class="mo" id="MathJax-Span-209" style="font-family: MathJax_Main; padding-left: 0.297em;">></span><span class="mi" id="MathJax-Span-210" style="font-family: MathJax_Math-italic; padding-left: 0.297em;">A</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.115em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>b</mi><mo>></mo><mi>A</mi></math></span></span><script type="math/tex" id="MathJax-Element-49">b > A</script></span>).</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-50-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-211" role="math" style="width: 1.081em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.885em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1000.84em, 2.306em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-212"><span class="mi" id="MathJax-Span-213" style="font-family: MathJax_Math-italic;">t</span><span class="mn" id="MathJax-Span-214" style="font-family: MathJax_Main;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-50">t0</script></span> (<strong>shift</strong>): the time before a “movement” is initiated, i.e., <em>non-decision time</em>.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-51-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>a</mi><mi>n</mi><mi mathvariant="normal">&#x005F;</mi><mi>v</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-215" role="math" style="width: 4.218em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.483em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.571em, 1003.48em, 2.355em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-216"><span class="mi" id="MathJax-Span-217" style="font-family: MathJax_Math-italic;">m</span><span class="mi" id="MathJax-Span-218" style="font-family: MathJax_Math-italic;">e</span><span class="mi" id="MathJax-Span-219" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-220" style="font-family: MathJax_Math-italic;">n</span><span class="mi" id="MathJax-Span-221" style="font-family: MathJax_Main;">_</span><span class="mi" id="MathJax-Span-222" style="font-family: MathJax_Math-italic;">v</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.115em; border-left: 0px solid; width: 0px; height: 0.709em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mi>e</mi><mi>a</mi><mi>n</mi><mi mathvariant="normal">_</mi><mi>v</mi></math></span></span><script type="math/tex" id="MathJax-Element-51">mean\_v</script></span> (<strong>difficulty</strong>): the mean drift rate and it’s variability (SD).</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-52-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>d</mi><mi mathvariant="normal">&#x005F;</mi><mi>v</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-223" role="math" style="width: 2.355em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.963em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1001.96em, 2.355em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-224"><span class="mi" id="MathJax-Span-225" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-226" style="font-family: MathJax_Math-italic;">d<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span class="mi" id="MathJax-Span-227" style="font-family: MathJax_Main;">_</span><span class="mi" id="MathJax-Span-228" style="font-family: MathJax_Math-italic;">v</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.115em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>d</mi><mi mathvariant="normal">_</mi><mi>v</mi></math></span></span><script type="math/tex" id="MathJax-Element-52">sd\_v</script></span>: the mean standard deviation of the drift rate and <em>its</em> variability (SD)</li>
</ul>
<p>Fit it using <code>glba::lba()</code>. There are some helpful distributions in the <code>rtdists</code> package.</p>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-18 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;">A = 0</span><span class="irs-max" style="visibility: visible;">A = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 41.9598%;">A = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">0.6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">0.8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">1.6</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 44.4724%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 44.4724%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_A" data-min="0" data-max="2" data-from="1" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="A = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-19 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">b = 1</span><span class="irs-max" style="visibility: visible;">b = 10</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 7.62144%;">b = 2</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">1.9</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">2.8</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">3.7</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">4.6</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.77387%;">5.5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">6.4</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">7.3</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">8.2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">9.1</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">10</span></span><span class="irs-bar" style="left: 5.52764%; width: 9.88275%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 9.88275%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_b" data-min="1" data-max="10" data-from="2" data-step="0.05" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="b = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-20 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;">t0 = -1</span><span class="irs-max" style="visibility: visible;">t0 = 2.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 25.219%;">t0 = 0.2</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -3.51759%;">-1</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: hidden; margin-left: -6.78392%;">-0.65</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -5.52764%;">-0.3</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -6.03015%;">0.05</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: hidden; margin-left: -5.77889%;">0.75</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.1</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -6.03015%;">1.45</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: hidden; margin-left: -5.77889%;">2.15</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.52261%;">2.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 30.4953%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 30.4953%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_t0" data-min="-1" data-max="2.5" data-from="0.2" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="t0 = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-21 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">mean(mean_v) = 0</span><span class="irs-max" style="visibility: hidden;">mean(mean_v) = 10</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 7.58794%;">mean(mean_v) = 3</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -2.76382%;">6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -2.76382%;">7</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -2.76382%;">9</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">10</span></span><span class="irs-bar" style="left: 5.52764%; width: 26.6834%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 26.6834%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_drift_mm" data-min="0" data-max="10" data-from="3" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="mean(mean_v) = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-22 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">sd(mean_v) = 0</span><span class="irs-max" style="visibility: visible;">sd(mean_v) = 6</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: -0.502513%;">sd(mean_v) = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">1.8</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">2.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">3.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">4.2</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">4.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">5.4</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">6</span></span><span class="irs-bar" style="left: 5.52764%; width: 14.8241%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 14.8241%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_drift_msd" data-min="0" data-max="6" data-from="1" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="sd(mean_v) = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-23 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">mean(sd_v) = 0</span><span class="irs-max" style="visibility: visible;">mean(sd_v) = 6</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: -0.502513%;">mean(sd_v) = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.52261%;">1.8</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.77387%;">2.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.52261%;">3.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">4.2</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.77387%;">4.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">5.4</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">6</span></span><span class="irs-bar" style="left: 5.52764%; width: 14.8241%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 14.8241%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_drift_sdm" data-min="0" data-max="6" data-from="1" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="mean(sd_v) = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-24 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">sd(sd_v) = 0</span><span class="irs-max" style="visibility: visible;">sd(sd_v) = 6</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 3.51759%;">sd(sd_v) = 1</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.6</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.52261%;">1.2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">2.4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">3.6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.77387%;">4.2</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">4.8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.52261%;">5.4</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">6</span></span><span class="irs-bar" style="left: 5.52764%; width: 14.8241%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 14.8241%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="lba_drift_sdsd" data-min="0" data-max="6" data-from="1" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="sd(sd_v) = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="outbb609c98676e4e29" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-gamma" class="section level2">
<div name="38_gamma" data-unique="38_gamma"></div><h2><span class="header-section-number">3.8</span> Gamma</h2>
<p>The gamma distribution is so important in statistics, that it probably spilled over to RT research as well. Although it can fit the data, it’s very hard to interpret the parameters in relation to RTs, and I will have little more to say. One could easily make a shifted Gamma, but I haven’t seen it used for the analysis of reaction times.</p>
<p><strong>Parameters:</strong></p>
<p>Both parameters in isolation are <strong>difficulty</strong>-like so their interaction determines <strong>scale</strong> and <strong>location</strong>. I think that this makes them <strong>messy</strong>.</p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-53-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-229" role="math" style="width: 0.787em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.64em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-230"><span class="mi" id="MathJax-Span-231" style="font-family: MathJax_Math-italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-53">\alpha</script></span> (<strong>messy</strong>): a shape parameter.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-54-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B2;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-232" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-233"><span class="mi" id="MathJax-Span-234" style="font-family: MathJax_Math-italic;">β<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.179em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>β</mi></math></span></span><script type="math/tex" id="MathJax-Element-54">\beta</script></span> (<strong>messy</strong>): a rate parameter.</li>
</ul>
<p>It is easy to infer these parameters from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-55-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B1;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-235" role="math" style="width: 0.787em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.64em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-236"><span class="mi" id="MathJax-Span-237" style="font-family: MathJax_Math-italic;">α</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>α</mi></math></span></span><script type="math/tex" id="MathJax-Element-55">\alpha</script></span> by <code>condition</code>. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-56-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03B2;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-238" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-239"><span class="mi" id="MathJax-Span-240" style="font-family: MathJax_Math-italic;">β<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.179em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>β</mi></math></span></span><script type="math/tex" id="MathJax-Element-56">\beta</script></span> is fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=gamma())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-25 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>α</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>α</i> = 50</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 6.63317%;"><i>α</i> = 5</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -2.76382%;">5</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.0201%;">10</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.0201%;">15</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.0201%;">20</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.0201%;">25</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.0201%;">30</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.0201%;">35</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.0201%;">40</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.0201%;">45</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">50</span></span><span class="irs-bar" style="left: 5.52764%; width: 8.89447%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 8.89447%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="gamma_alpha" data-min="0" data-max="50" data-from="5" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&alpha;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-26 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>β</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>β</i> = 50</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 14.0201%;"><i>β</i> = 10</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -2.76382%;">5</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.0201%;">10</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.0201%;">15</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.0201%;">20</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -4.0201%;">25</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.0201%;">30</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.0201%;">35</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.0201%;">40</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.0201%;">45</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">50</span></span><span class="irs-bar" style="left: 5.52764%; width: 17.7889%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 17.7889%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="gamma_beta" data-min="0" data-max="50" data-from="10" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&beta;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="outbb7c983130ec15d8" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
<div id="section-sweibull" class="section level2">
<div name="39_(shifted)_weibull" data-unique="39_(shifted)_weibull"></div><h2><span class="header-section-number">3.9</span> (Shifted) Weibull</h2>
<p>… also called the <em>three-parameter Weibull</em> when there is a shift parameter. For RTs, it can be understood as modeling there being an underlying rate with which underlying non-response processes are “turned into” responses over time. If <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-57-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi><mo>=</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-241" role="math" style="width: 2.944em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.453em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1002.4em, 2.306em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-242"><span class="mi" id="MathJax-Span-243" style="font-family: MathJax_Math-italic;">λ</span><span class="mo" id="MathJax-Span-244" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-245" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-57">\lambda = 0</script></span>, this rate is constant. If <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-58-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi><mo>&gt;</mo><mn>1</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-246" role="math" style="width: 2.944em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.453em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1002.4em, 2.355em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-247"><span class="mi" id="MathJax-Span-248" style="font-family: MathJax_Math-italic;">λ</span><span class="mo" id="MathJax-Span-249" style="font-family: MathJax_Main; padding-left: 0.297em;">></span><span class="mn" id="MathJax-Span-250" style="font-family: MathJax_Main; padding-left: 0.297em;">1</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.115em; border-left: 0px solid; width: 0px; height: 1.003em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi><mo>></mo><mn>1</mn></math></span></span><script type="math/tex" id="MathJax-Element-58">\lambda > 1</script></span>, it decreases over time. The parameter <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-59-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>v</mi><mi>a</mi><mi>l</mi><mi>u</mi><mi>e</mi><mi>s</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-251" role="math" style="width: 3.434em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.846em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.8em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-252"><span class="mi" id="MathJax-Span-253" style="font-family: MathJax_Math-italic;">v</span><span class="mi" id="MathJax-Span-254" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-255" style="font-family: MathJax_Math-italic;">l</span><span class="mi" id="MathJax-Span-256" style="font-family: MathJax_Math-italic;">u</span><span class="mi" id="MathJax-Span-257" style="font-family: MathJax_Math-italic;">e</span><span class="mi" id="MathJax-Span-258" style="font-family: MathJax_Math-italic;">s</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>v</mi><mi>a</mi><mi>l</mi><mi>u</mi><mi>e</mi><mi>s</mi></math></span></span><script type="math/tex" id="MathJax-Element-59">values</script></span> do not correspond to anything intuitive, though.</p>
<p><strong>Parameters:</strong></p>
<ul>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-60-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-259" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-260"><span class="mi" id="MathJax-Span-261" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-60">\lambda</script></span> (<strong>difficulty</strong>): It’s called a scale parameter for some reason, but it affects the mean, median, and mode.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-61-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>k</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-262" role="math" style="width: 0.64em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.542em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-263"><span class="mi" id="MathJax-Span-264" style="font-family: MathJax_Math-italic;">k</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>k</mi></math></span></span><script type="math/tex" id="MathJax-Element-61">k</script></span> (<strong>messy</strong>): A shape parameter.</li>
<li><span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-62-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-265" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-266"><span class="mi" id="MathJax-Span-267" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-268" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-269" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-270" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-271" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-62">shift</script></span> (<strong>onset</strong>): when <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-63-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-272" role="math" style="width: 5.002em; display: inline-block;"><span style="display: inline-block; position: relative; width: 4.169em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1004.12em, 2.502em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-273"><span class="mi" id="MathJax-Span-274" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-275" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-276" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-277" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-278" style="font-family: MathJax_Math-italic;">t</span><span class="mo" id="MathJax-Span-279" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-280" style="font-family: MathJax_Main; padding-left: 0.297em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi><mo>=</mo><mn>0</mn></math></span></span><script type="math/tex" id="MathJax-Element-63">shift = 0</script></span>, it’s a straight-up <em>Weibull distribution</em> with the above two parameters.</li>
</ul>
<p>It is easy to infer the parameters of the (non-shifted) Weibull from data. Here, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-64-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BB;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-281" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-282"><span class="mi" id="MathJax-Span-283" style="font-family: MathJax_Math-italic;">λ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>λ</mi></math></span></span><script type="math/tex" id="MathJax-Element-64">\lambda</script></span> by <code>condition</code>. It is log, so use <code>exp()</code> to back-transform. <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-65-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>k</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-284" role="math" style="width: 0.64em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.542em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1000.54em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-285"><span class="mi" id="MathJax-Span-286" style="font-family: MathJax_Math-italic;">k</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>k</mi></math></span></span><script type="math/tex" id="MathJax-Element-65">k</script></span> is fixed across conditions. See <a href="http://127.0.0.1:7203/index.Rmd#section-models">notes on modeling</a> and the <a href="http://127.0.0.1:7203/index.Rmd#section-code">applied example</a> for more details.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(rt ~ condition, rt_data, family=weibull())</code></pre>
<hr>
<p></p><div class="col-sm-4">
<form class="well">
<div class="form-group shiny-input-container">
<span class="irs js-irs-27 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;"><i>λ</i> = 0</span><span class="irs-max" style="visibility: visible;"><i>λ</i> = 2.5</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 13.2663%;"><i>λ</i> = 0.5</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -6.03015%;">0.25</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.5</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: hidden; margin-left: -5.77889%;">0.75</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -6.03015%;">1.25</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.5</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: hidden; margin-left: -5.77889%;">1.75</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -6.03015%;">2.25</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.77387%;">2.5</span></span><span class="irs-bar" style="left: 5.52764%; width: 17.7889%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 17.7889%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sweibull_lambda" data-min="0" data-max="2.5" data-from="0.5" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="<i>&lambda;</i> = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-28 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: visible;">k = 0</span><span class="irs-max" style="visibility: visible;">k = 10</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: 15.2965%;">k = 2.2</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -2.76382%;">2</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -2.76382%;">3</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -2.76382%;">4</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">5</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -2.76382%;">6</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -2.76382%;">7</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -2.76382%;">8</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -2.76382%;">9</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -4.0201%;">10</span></span><span class="irs-bar" style="left: 5.52764%; width: 19.5678%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 19.5678%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sweibull_k" data-min="0" data-max="10" data-from="2.2" data-step="0.1" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="k = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
<div class="form-group shiny-input-container">
<span class="irs js-irs-29 irs-with-grid"><span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min" style="visibility: hidden;">shift = 0</span><span class="irs-max" style="visibility: visible;">shift = 2</span><span class="irs-from" style="visibility: hidden;">0</span><span class="irs-to" style="visibility: hidden;">0</span><span class="irs-single" style="left: -5.77889%;">shift = 0</span></span><span class="irs-grid" style="width: 88.9447%; left: 5.42764%;"><span class="irs-grid-pol" style="left: 0%"></span><span class="irs-grid-text js-grid-text-0" style="left: 0%; margin-left: -2.76382%;">0</span><span class="irs-grid-pol small" style="left: 6.666666666666666%"></span><span class="irs-grid-pol small" style="left: 3.333333333333333%"></span><span class="irs-grid-pol" style="left: 10%"></span><span class="irs-grid-text js-grid-text-1" style="left: 10%; visibility: visible; margin-left: -4.52261%;">0.2</span><span class="irs-grid-pol small" style="left: 16.666666666666668%"></span><span class="irs-grid-pol small" style="left: 13.333333333333332%"></span><span class="irs-grid-pol" style="left: 20%"></span><span class="irs-grid-text js-grid-text-2" style="left: 20%; visibility: visible; margin-left: -4.77387%;">0.4</span><span class="irs-grid-pol small" style="left: 26.666666666666668%"></span><span class="irs-grid-pol small" style="left: 23.333333333333332%"></span><span class="irs-grid-pol" style="left: 30%"></span><span class="irs-grid-text js-grid-text-3" style="left: 30%; visibility: visible; margin-left: -4.77387%;">0.6</span><span class="irs-grid-pol small" style="left: 36.666666666666664%"></span><span class="irs-grid-pol small" style="left: 33.333333333333336%"></span><span class="irs-grid-pol" style="left: 40%"></span><span class="irs-grid-text js-grid-text-4" style="left: 40%; margin-left: -4.52261%;">0.8</span><span class="irs-grid-pol small" style="left: 46.666666666666664%"></span><span class="irs-grid-pol small" style="left: 43.333333333333336%"></span><span class="irs-grid-pol" style="left: 50%"></span><span class="irs-grid-text js-grid-text-5" style="left: 50%; visibility: visible; margin-left: -2.76382%;">1</span><span class="irs-grid-pol small" style="left: 56.666666666666664%"></span><span class="irs-grid-pol small" style="left: 53.333333333333336%"></span><span class="irs-grid-pol" style="left: 60%"></span><span class="irs-grid-text js-grid-text-6" style="left: 60%; visibility: visible; margin-left: -4.77387%;">1.2</span><span class="irs-grid-pol small" style="left: 66.66666666666667%"></span><span class="irs-grid-pol small" style="left: 63.333333333333336%"></span><span class="irs-grid-pol" style="left: 70%"></span><span class="irs-grid-text js-grid-text-7" style="left: 70%; visibility: visible; margin-left: -4.52261%;">1.4</span><span class="irs-grid-pol small" style="left: 76.66666666666667%"></span><span class="irs-grid-pol small" style="left: 73.33333333333333%"></span><span class="irs-grid-pol" style="left: 80%"></span><span class="irs-grid-text js-grid-text-8" style="left: 80%; margin-left: -4.52261%;">1.6</span><span class="irs-grid-pol small" style="left: 86.66666666666667%"></span><span class="irs-grid-pol small" style="left: 83.33333333333333%"></span><span class="irs-grid-pol" style="left: 90%"></span><span class="irs-grid-text js-grid-text-9" style="left: 90%; visibility: visible; margin-left: -4.77387%;">1.8</span><span class="irs-grid-pol small" style="left: 96.66666666666667%"></span><span class="irs-grid-pol small" style="left: 93.33333333333333%"></span><span class="irs-grid-pol" style="left: 100%"></span><span class="irs-grid-text js-grid-text-10" style="left: 100%; visibility: visible; margin-left: -2.76382%;">2</span></span><span class="irs-bar" style="left: 5.52764%; width: 0%;"></span><span class="irs-bar-edge"></span><span class="irs-shadow shadow-single" style="display: none;"></span><span class="irs-slider single" style="left: 0%;"></span></span><input class="js-range-slider irs-hidden-input shiny-bound-input" id="sweibull_shift" data-min="0" data-max="2" data-from="0" data-step="0.01" data-grid="true" data-grid-num="10" data-grid-snap="false" data-prettify-separator="," data-prettify-enabled="true" data-prefix="shift = " data-keyboard="true" data-data-type="number" tabindex="-1" readonly="">
</div>
</form>
</div><div class="col-sm-8">
<div id="out8dbd4c7b356991b6" class="shiny-plot-output shiny-bound-output" style="width: 100% ; height: "></div>
</div><p></p>
<div class="vertical_spacer">
</div>
</div>
</div>
<div id="section-code" class="section level1">
<div name="4_applied_code_example" data-unique="4_applied_code_example"></div><h1><span class="header-section-number">4</span> Applied code example</h1>
<p>We load the Wagenmakers & Brown (2007) data and pre-process it:</p>
<pre class="r"><code class="hljs"><span class="hljs-comment"># Load data</span>
<span class="hljs-keyword">library</span>(rtdists)
data(speed_acc)
<span class="hljs-comment"># Remove bad trials</span>
<span class="hljs-keyword">library</span>(tidyverse)
data = speed_acc %>%
filter(rt > <span class="hljs-number">0.18</span>, rt < <span class="hljs-number">3</span>) %>% <span class="hljs-comment"># Between 180 and 3000 ms</span>
mutate_at(c(<span class="hljs-string">'stim_cat'</span>, <span class="hljs-string">'response'</span>), as.character) %>% <span class="hljs-comment"># from factor to char</span>
filter(response != <span class="hljs-string">'error'</span>, stim_cat == response) <span class="hljs-comment"># Only correct responses</span></code></pre>
<p>Now we use the <a href="http://127.0.0.1:7203/index.Rmd#section-slog">shifted log-normal</a> to ask: “Does median RT differ by condition?”. In other words, we model <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-66-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-287" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-288"><span class="mi" id="MathJax-Span-289" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-66">\mu</script></span> here, leaving the scale <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-67-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-290" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-291"><span class="mi" id="MathJax-Span-292" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-67">\sigma</script></span> and the onset <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-68-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-293" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-294"><span class="mi" id="MathJax-Span-295" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-296" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-297" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-298" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-299" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-68">shift</script></span> fixed. We include a random intercept per participant, but <a href="http://127.0.0.1:7203/index.Rmd#section-models">see my notes on formulas for RT models</a>. In this example, it takes some time to run it because we have around 28.000 data points.</p>
<pre class="r"><code class="hljs"><span class="hljs-keyword">library</span>(brms)
fit = brm(formula = rt ~ condition + (<span class="hljs-number">1</span>|id),
dat = data,
family = shifted_lognormal(),
file = <span class="hljs-string">'fit_slog'</span>) <span class="hljs-comment"># Save all that hard work.</span></code></pre>
<p>Done!</p>
<div id="section-checking-the-fit" class="section level2">
<div name="41_checking_the_fit" data-unique="41_checking_the_fit"></div><h2><span class="header-section-number">4.1</span> Checking the fit</h2>
<p>Much like the interactive applets above, we can see how the parameters predict the actual data:</p>
<pre class="r"><code class="hljs"><span class="hljs-comment">#plot(fit) # Check convergence and see posteriors</span>
pp_check(fit) <span class="hljs-comment"># Posterior predictive check</span></code></pre>
<p><img src="./Reaction time distributions_ an interactive overview_files/code_ppcheck.png"></p>
<p>This is <em>much</em> better than a Gaussian. But there’s room for improvement. Mostly because <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-69-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-300" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-301"><span class="mi" id="MathJax-Span-302" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-303" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-304" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-305" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-306" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-69">shift</script></span> is close to the earliest rt <em>in the whole dataset</em>, which for one participant (id #8) in one condition was 0.18 - just above the trim. The mean shortest rt was 0.28 seconds so that participant is not representative. Setting one <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-70-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-307" role="math" style="width: 2.797em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.306em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.26em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-308"><span class="mi" id="MathJax-Span-309" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-310" style="font-family: MathJax_Math-italic;">h</span><span class="mi" id="MathJax-Span-311" style="font-family: MathJax_Math-italic;">i</span><span class="mi" id="MathJax-Span-312" style="font-family: MathJax_Math-italic;">f<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.051em;"></span></span><span class="mi" id="MathJax-Span-313" style="font-family: MathJax_Math-italic;">t</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 1.238em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>h</mi><mi>i</mi><mi>f</mi><mi>t</mi></math></span></span><script type="math/tex" id="MathJax-Element-70">shift</script></span> per participant would make more sense:</p>
<pre class="r"><code class="hljs">formula = bf(rt ~ condition + (<span class="hljs-number">1</span>|id),
ndt ~ id)</code></pre>
<p>Also, the shortest N RTs could be removed for each participant, if you can argue that they were accidental responses:</p>
<pre class="r"><code class="hljs">data %>%
group_by(id) %>%
arrange(rt) %>%
slice(<span class="hljs-number">4</span>:n()) <span class="hljs-comment"># Remove three shortest RTs</span></code></pre>
</div>
<div id="section-understanding-the-parameter-estimates" class="section level2">
<div name="42_understanding_the_parameter_estimates" data-unique="42_understanding_the_parameter_estimates"></div><h2><span class="header-section-number">4.2</span> Understanding the parameter estimates</h2>
<p>Leaving that aside, let’s see what we learned about the parameters of the shifted log-normal model. <code>Intercept</code> and <code>conditionspeed</code> together define <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-71-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-314" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-315"><span class="mi" id="MathJax-Span-316" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-71">\mu</script></span> (the difficulty). You can see <code>sigma</code> (the scale) and <code>ndt</code> (the onset) too, so we have posteriors for all of our three parameters!</p>
<pre class="r"><code class="hljs">summary(fit) <span class="hljs-comment"># See parameters</span></code></pre>
<pre class="r"><code class="hljs">Population-Level Effects:
Estimate Est.Error l-<span class="hljs-number">95</span>% CI u-<span class="hljs-number">95</span>% CI Rhat Bulk_ESS Tail_ESS
Intercept -<span class="hljs-number">0.69</span> <span class="hljs-number">0.04</span> -<span class="hljs-number">0.76</span> -<span class="hljs-number">0.61</span> <span class="hljs-number">1.01</span> <span class="hljs-number">508</span> <span class="hljs-number">672</span>
conditionspeed -<span class="hljs-number">0.40</span> <span class="hljs-number">0.00</span> -<span class="hljs-number">0.41</span> -<span class="hljs-number">0.39</span> <span class="hljs-number">1.00</span> <span class="hljs-number">2184</span> <span class="hljs-number">2143</span>
Family Specific Parameters:
Estimate Est.Error l-<span class="hljs-number">95</span>% CI u-<span class="hljs-number">95</span>% CI Rhat Bulk_ESS Tail_ESS
sigma <span class="hljs-number">0.37</span> <span class="hljs-number">0.00</span> <span class="hljs-number">0.36</span> <span class="hljs-number">0.37</span> <span class="hljs-number">1.00</span> <span class="hljs-number">1839</span> <span class="hljs-number">2088</span>
ndt <span class="hljs-number">0.17</span> <span class="hljs-number">0.00</span> <span class="hljs-number">0.17</span> <span class="hljs-number">0.18</span> <span class="hljs-number">1.00</span> <span class="hljs-number">1576</span> <span class="hljs-number">1724</span></code></pre>
<p>Because <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-72-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03BC;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-317" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.453em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-318"><span class="mi" id="MathJax-Span-319" style="font-family: MathJax_Math-italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.291em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>μ</mi></math></span></span><script type="math/tex" id="MathJax-Element-72">\mu</script></span> and <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-73-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>&#x03C3;</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-320" role="math" style="width: 0.738em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.591em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.522em, 1000.59em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-321"><span class="mi" id="MathJax-Span-322" style="font-family: MathJax_Math-italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.65em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>σ</mi></math></span></span><script type="math/tex" id="MathJax-Element-73">\sigma</script></span> define the <em>log</em>-normal distribution, they are on a log scale. This means that we expect a median RT of <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-74-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mi>d</mi><mi>t</mi><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mi>&#x03BC;</mi><mo stretchy="false">)</mo><mo>=</mo><mn>0.17</mn><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mo>&#x2212;</mo><mn>0.69</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0.50</mn></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-323" role="math" style="width: 21.767em; display: inline-block;"><span style="display: inline-block; position: relative; width: 18.14em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1018.09em, 2.551em, -999.998em); top: -2.154em; left: 0.002em;"><span class="mrow" id="MathJax-Span-324"><span class="mi" id="MathJax-Span-325" style="font-family: MathJax_Math-italic;">n</span><span class="mi" id="MathJax-Span-326" style="font-family: MathJax_Math-italic;">d<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.002em;"></span></span><span class="mi" id="MathJax-Span-327" style="font-family: MathJax_Math-italic;">t</span><span class="mo" id="MathJax-Span-328" style="font-family: MathJax_Main; padding-left: 0.248em;">+</span><span class="mi" id="MathJax-Span-329" style="font-family: MathJax_Math-italic; padding-left: 0.248em;">e</span><span class="mi" id="MathJax-Span-330" style="font-family: MathJax_Math-italic;">x</span><span class="mi" id="MathJax-Span-331" style="font-family: MathJax_Math-italic;">p</span><span class="mo" id="MathJax-Span-332" style="font-family: MathJax_Main;">(</span><span class="mi" id="MathJax-Span-333" style="font-family: MathJax_Math-italic;">μ</span><span class="mo" id="MathJax-Span-334" style="font-family: MathJax_Main;">)</span><span class="mo" id="MathJax-Span-335" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-336" style="font-family: MathJax_Main; padding-left: 0.297em;">0.17</span><span class="mo" id="MathJax-Span-337" style="font-family: MathJax_Main; padding-left: 0.248em;">+</span><span class="mi" id="MathJax-Span-338" style="font-family: MathJax_Math-italic; padding-left: 0.248em;">e</span><span class="mi" id="MathJax-Span-339" style="font-family: MathJax_Math-italic;">x</span><span class="mi" id="MathJax-Span-340" style="font-family: MathJax_Math-italic;">p</span><span class="mo" id="MathJax-Span-341" style="font-family: MathJax_Main;">(</span><span class="mo" id="MathJax-Span-342" style="font-family: MathJax_Main;">−</span><span class="mn" id="MathJax-Span-343" style="font-family: MathJax_Main;">0.69</span><span class="mo" id="MathJax-Span-344" style="font-family: MathJax_Main;">)</span><span class="mo" id="MathJax-Span-345" style="font-family: MathJax_Main; padding-left: 0.297em;">=</span><span class="mn" id="MathJax-Span-346" style="font-family: MathJax_Main; padding-left: 0.297em;">0.50</span></span><span style="display: inline-block; width: 0px; height: 2.159em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.35em; border-left: 0px solid; width: 0px; height: 1.297em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mi>d</mi><mi>t</mi><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mi>μ</mi><mo stretchy="false">)</mo><mo>=</mo><mn>0.17</mn><mo>+</mo><mi>e</mi><mi>x</mi><mi>p</mi><mo stretchy="false">(</mo><mo>−</mo><mn>0.69</mn><mo stretchy="false">)</mo><mo>=</mo><mn>0.50</mn></math></span></span><script type="math/tex" id="MathJax-Element-74">ndt + exp(\mu) = 0.17 + exp(-0.69) = 0.50</script></span> seconds for condition “accuracy” (the intercept), and a median RT of <code>exp(-0.69 -0.40) = 0.34</code> seconds for condition “speed”. If you get confused about these transformations, worry not. <code>brms</code> has you covered, no matter the distribution:</p>
<pre class="r"><code class="hljs">marginal_effects(fit) <span class="hljs-comment"># Back-transformed parameter estimates</span>
marginal_effects(fit, method=<span class="hljs-string">'predict'</span>) <span class="hljs-comment"># Same, but for responses</span></code></pre>
<p>We are very certain that they respond faster for “speed” because the upper bound of the credible interval is much smaller than zero. We could test this more directly:</p>
<pre class="r"><code class="hljs">hypothesis(fit, <span class="hljs-string">'conditionspeed < 0'</span>) <span class="hljs-comment"># Numerically</span></code></pre>
</div>
<div id="section-priors-and-descriptives" class="section level2">
<div name="43_priors_and_descriptives" data-unique="43_priors_and_descriptives"></div><h2><span class="header-section-number">4.3</span> Priors and descriptives</h2>
<p>I cut corners here for the sake of brevity. Instead of going with the default priors, I would have specified something sensible and run <code>brm(..., prior=prior)</code>. Mostly as <a href="https://en.wikipedia.org/wiki/Regularization_(mathematics)">regularization</a>. There is so much data that most priors will be overwhelmed.</p>
<pre class="r"><code class="hljs"><span class="hljs-comment"># See which priors you can set for this model</span>
get_prior(rt ~ condition + (<span class="hljs-number">1</span>|id), speed_acc, family = shifted_lognormal())
<span class="hljs-comment"># Define them</span>
prior = c(
set_prior(<span class="hljs-string">'normal(-1, 0.5)'</span>, class = <span class="hljs-string">'Intercept'</span>), <span class="hljs-comment"># around exp(-1) = 0.36 secs</span>
set_prior(<span class="hljs-string">'normal(0.4, 0.3)'</span>, class = <span class="hljs-string">'sigma'</span>), <span class="hljs-comment"># SD of individual rts in log-units</span>
set_prior(<span class="hljs-string">'normal(0, 0.3)'</span>, class = <span class="hljs-string">'b'</span>), <span class="hljs-comment"># around exp(-1) - exp(-1 + 0.3) = 150 ms effect in either direction</span>
set_prior(<span class="hljs-string">'normal(0.3, 0.1)'</span>, class = <span class="hljs-string">'sd'</span>) <span class="hljs-comment"># some variability between participants</span>
)</code></pre>
<p>I would probably also have checked that the pre-processing worked by plotting the response distributions of a few participants:</p>
<pre class="r"><code class="hljs">data_plot = filter(data, id %<span class="hljs-keyword">in</span>% c(<span class="hljs-number">1</span>, <span class="hljs-number">8</span>, <span class="hljs-number">15</span>))
ggplot(data_plot, aes(x=rt)) +
geom_histogram(aes(fill=condition), alpha=<span class="hljs-number">0.5</span>, bins=<span class="hljs-number">60</span>) +
facet_grid(~id) + <span class="hljs-comment"># One panel per id</span>
coord_cartesian(xlim=c(<span class="hljs-number">0</span>, <span class="hljs-number">1.6</span>)) <span class="hljs-comment"># Zoom in</span></code></pre>
<p><img src="./Reaction time distributions_ an interactive overview_files/code_histograms.png"></p>
</div>
</div>
<div id="section-models" class="section level1">
<div name="5_notes_on_good_models_for_rt_data" data-unique="5_notes_on_good_models_for_rt_data"></div><h1><span class="header-section-number">5</span> Notes on good models for RT data</h1>
<p>Throughout this document, I have used a simple model: <code>rt ~ condition</code> to demo code. For real-world data, you probably know a lot more about the data generating process. This is a better typical recipe:</p>
<pre class="r"><code class="hljs">rt ~ condition + covariates + (condition | id) + (<span class="hljs-number">1</span>|nuisance)</code></pre>
<p>This could be an example of using this recipe:</p>
<pre class="r"><code class="hljs">rt ~ congruent + trial_no + bad_lag1 + (congruent|id) + (<span class="hljs-number">1</span>|counterbalancing)</code></pre>
<p>Let’s unpack this:</p>
<ul>
<li><p><code>condition</code> is our contrast of interest. This can be a variable coded as congruent/incongruent, the number of items in a visual search, or something else. It can also be an interaction. I just did an analysis where I had a <code>congruent:condition</code> term to model a congruency effect per condition.</p></li>
<li><p><code>covariates</code> could be, e.g., <code>trial_no + bad_lag1</code>, i.e., the effect of time (people typically get faster with practice) and longer RTs on the first trial in a block (you need to code this variable). It is often a good idea to <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-75-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>c</mi><mi>a</mi><mi>l</mi><mi>e</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-347" role="math" style="width: 2.65em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.208em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.277em, 1002.16em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-348"><span class="mi" id="MathJax-Span-349" style="font-family: MathJax_Math-italic;">s</span><span class="mi" id="MathJax-Span-350" style="font-family: MathJax_Math-italic;">c</span><span class="mi" id="MathJax-Span-351" style="font-family: MathJax_Math-italic;">a</span><span class="mi" id="MathJax-Span-352" style="font-family: MathJax_Math-italic;">l</span><span class="mi" id="MathJax-Span-353" style="font-family: MathJax_Math-italic;">e</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.944em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mi>c</mi><mi>a</mi><mi>l</mi><mi>e</mi></math></span></span><script type="math/tex" id="MathJax-Element-75">scale</script></span> these to help the model fit, and to <span class="math inline"><span class="MathJax_Preview" style="color: inherit;"></span><span class="MathJax" id="MathJax-Element-76-Frame" tabindex="0" data-mathml="<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>c</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>e</mi><mi>r</mi></math>" role="presentation" style="position: relative;"><nobr aria-hidden="true"><span class="math" id="MathJax-Span-354" role="math" style="width: 3.385em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.797em; height: 0px; font-size: 120%;"><span style="position: absolute; clip: rect(1.326em, 1002.8em, 2.257em, -999.998em); top: -2.105em; left: 0.002em;"><span class="mrow" id="MathJax-Span-355"><span class="mi" id="MathJax-Span-356" style="font-family: MathJax_Math-italic;">c</span><span class="mi" id="MathJax-Span-357" style="font-family: MathJax_Math-italic;">e</span><span class="mi" id="MathJax-Span-358" style="font-family: MathJax_Math-italic;">n</span><span class="mi" id="MathJax-Span-359" style="font-family: MathJax_Math-italic;">t</span><span class="mi" id="MathJax-Span-360" style="font-family: MathJax_Math-italic;">e</span><span class="mi" id="MathJax-Span-361" style="font-family: MathJax_Math-italic;">r</span></span><span style="display: inline-block; width: 0px; height: 2.11em;"></span></span></span><span style="display: inline-block; overflow: hidden; vertical-align: -0.056em; border-left: 0px solid; width: 0px; height: 0.885em;"></span></span></nobr><span class="MJX_Assistive_MathML" role="presentation"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>c</mi><mi>e</mi><mi>n</mi><mi>t</mi><mi>e</mi><mi>r</mi></math></span></span><script type="math/tex" id="MathJax-Element-76">center</script></span> them (possible for continuous and binary predictors) so that the effect of <code>condition</code> represents the mean of the other conditions rather than a certain combination. You can use <code>scale</code> to scale and center.</p></li>
<li><p><code>(condition | id)</code> models the expected individual differences in general <code>rt</code>, and allows the effect of <code>condition</code> to vary between participants. The practical effect of specifying a random effect rather than a fixed <code>condition:id</code> effect is that <a href="https://lindeloev.net/lets-rename-fixed-to-population-level-and-random-to-varying/">you get <em>shrinkage</em> in the former</a>, naturally imposing a bit of control for outliers. Unfortunately, complicated random effects sometimes increase computation time considerably.</p></li>
<li><p><code>(1 | nuisance)</code> is a way to let the model “understand” a structure in the data, without having it affect the fixed parameter estimates. If you have a factorial design, the otherwise non-modeled design variables would generally go here.</p></li>
</ul>
</div>
<div class="footnotes">
<hr>
<ol>
<li id="section-fn1"><p>“Difficulty” is a term borrowed from <a href="http://ejwagenmakers.com/2007/WagenmakersBrown2007.pdf">Wagenmakers & Brown (2007)</a>, but it is not standard<a href="http://127.0.0.1:7203/index.Rmd#section-fnref1" class="footnote-back">↩</a></p></li>
<li id="section-fn2"><p>Some distributions are parameterized using <em>rate</em> which is the inverse of <em>location center</em>.<a href="http://127.0.0.1:7203/index.Rmd#section-fnref2" class="footnote-back">↩</a></p></li>
<li id="section-fn3"><p>Many distributions include a <em>shape</em> parameter, but since all RT distributions have approximately the same shape, I’d rather pick a distribution which inherently has the “right” shape, than model this using a parameter.<a href="http://127.0.0.1:7203/index.Rmd#section-fnref3" class="footnote-back">↩</a></p></li>
</ol>
</div>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("section-TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open')
});
});
</script>
<!-- code folding -->
<script>
$(document).ready(function () {
// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');
// establish options
var options = {
selectors: "h1,h2",
theme: "bootstrap3",
context: '.toc-content',
hashGenerator: function (text) {
return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_').toLowerCase();
},
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = false;
options.smoothScroll = true;
// tocify
var toc = $("#section-TOC").tocify(options).data("toc-tocify");
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "mathjax-local/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</div>
</div>