temp/tutorial_intro/tutorial_intro.md

addmtoolbox: tutorial

author: Alexander Fengler date: 03.03.2015 font-family: 'Helvetica';

aDDM: quick intro // equations 2 items

Equations: 2 Items

Fixation left: $$ \begin{aligned} RDV_t = RDV_{t-1} + d(r_{left} - \thetar_{right}) + \epsilon_t \end{aligned} $$

Fixation right: $$ \begin{aligned} RDV_t = RDV_{t-1} + d(\thetar_{left} - r_{right}) + \epsilon_t \end{aligned} $$

Decision taken if $RDV_t > 1$ | $RDV_t < -1$ ....

aDDM: quick intro // n > 2 items

Acummulate Evidence (Item 1 Fixated):

$$ \begin{align} E^{1}t &= E^{1}{t-1} + dV^{1} + \epsilon_{t} \ E^{2}t &= E^{2}{t-1} + \thetadV^{2} + \epsilon_{t} \ E^{3}t &= E^{3}{t-1} + \thetadV^{3} + \epsilon_{t} \ \end{align*} $$

Compute Global RDV:

$$ \begin{align} RDV^{1}_t &= E^{1}_t - max(E^{2}_t,E^{3}_t) \ RDV^{2}_t &= E^{2}_t - max(E^{1}_t,E^{3}_t) \ RDV^{3}_t &= E^{3}_t - max(E^{1}_t,E^{2}_t) \ \end{align} $$

$$ \begin{align} RDVG_t &= max(RDV^{1}_t, RDV^{2}_t, RDV^{3}_t) \ \end{align} $$

aDDM: quick intro // multiattribute (2)

Fixation left (Attribute 1):

$$ \begin{align*}

RDV_t = RDV_{t-1} + d(V^{1}_1 - \thetaV^{2}_1 + \gamma(V^{1}_2 - thetaV^{2}_2)) + \epsilon_t

\end{align*} $$

Decision taken if $RDV_t > 1$ | $RDV_t < -1$ ....

New parameter $\gamma$ that discounts unfixated attributes separately.

aDDM: quick intro // code

left: 30%

Variables:

# Item Valuations
v1 = 2
v2 = 4

# Model
rdv = 0
theta = 0.1
d = 0.002
sd = 0.02

Model:

fixpos.vector = rep(c(1, 2, 1, 2), each = 250)
time = 1

while (rdv < 1 & rdv > -1) {

    if (fixpos.vector[time] == 1) {
        rdv = rdv + d * (v1 - theta * v2) + rnorm(1, 0, sd)
    }

    if (fixpos.vector[time] == 2) {
        rdv = rdv + d * (theta * v1 - v2) + rnorm(1, 0, sd)
    }

    time = time + 1
}

aDDM: quick intro // visualization

plot of chunk unnamed-chunk-4

aDDM quick intro // likelihood

We simulate the model (many times) with a given set of parameters...

Then produce table like this,

| Trial id | Choice | RT Bin | Likelihood of event (given our model / parameters)| | ---------|------ |------|----------| |1| 1 | 1800 | 0.03 | |2| 1 | 2200 | 0.05 | |3| 2 | 2000 | 0.04 | |.| . | . | . | |.| . | . | . | |n| 1 | 3000 | 0.02 |

Then we take the sum of the log of the likelihood values.

aDDM quick intro // fit by condition

Standard way of fitting the addm,

Implemented in addmtoolbox. You can supply your own arbitrary fixation model and the package will use it in the simulations.

Example fixation models included. Fixed and random fixation pathways with fixed duration length.

aDDM quick intro // fit by trial

Alternative way of fitting the addm,

Implemented in addmtoolbox. Note, that you will still need a fixation model when simulating a fake data set, once you have the optimal parameters!

addmtoolbox: functions

What does it do for you?

Data Preprocessing

Generate Fake Data

Model Simulation

Model Fitting

Plotting Results

Functions

addm_preprocess()

addm_generate...()

addm_run...()

addm_fit...()

addm_plot...()

addmtoolbox: internal functions

What does it do for you?

Internal computations

Evidence Accumulation

Functions

addm_support...( )

aevacc_...( ) (c++)

addmtoolbox: internal functions

All functions are documented and available to you!

Every function that has a "2" in it's name (addm2_, aevacc2_) is preferred when working with two items. Other functions with the same name are item general.

addmtoolbox: documentation

General Package info:

?addmtoolbox

Detailed function documentation:

?addm_preprocess

Tutorials:

# List Vignettes
vignette(package = 'addmtoolbox')
# Access Vignette
vignette('addmtoolbox_modelfit_walkthrough')

addmtoolbox: data

The addmtoolbox comes with a full set of example data. to make it easier to,

The corresponding data frames are automatically loaded with the package.

View(addm_data_choice)
View(addm_data_eye)

addmtoolbox: data

Data Type

Choice/RT Data

Eyetracking Data

Example Loglikelihood output

Detailed aDDM Output

Data Frame

addm_data_choice

addm_data_eye

addm_data_loglik_trial/condition

addm_data_full_output

addmtoolbox: benchmarks // 1-6

addmtoolbox: benchmarks // 2-6

addmtoolbox: benchmarks // 3-6

addmtoolbox: benchmarks // 4-6

addmtoolbox: benchmarks // 5-6

addmtoolbox: benchmark // 6-6

wd

getwd()
[1] "/Users/admin/OneDrive/git_repos/addmtoolbox/temp/tutorial_intro"

addmtoolbox

Questions?



AlexanderFengler/addmtoolbox documentation built on May 5, 2019, 4:53 a.m.