SequentialSamplingModels.AbstractDDM
— TypeAbstractDDM <: SSM2D
An abstract type for the drift diffusion model.
SequentialSamplingModels.AbstractLBA
— TypeAbstractLBA <: SSM2D
An abstract type for the linear ballistic accumulator model.
SequentialSamplingModels.AbstractLCA
— TypeAbstractLCA <: SSM2D
An abstract type for the leaky competing accumulator model
SequentialSamplingModels.AbstractLNR
— TypeAbstractLNR <: SSM2D
An abstract type for the lognormal race model
SequentialSamplingModels.AbstractPoissonRace
— TypeAbstractPoissonRace <: SSM2D
An abstract type for the Poisson race model.
SequentialSamplingModels.AbstractRDM
— TypeAbstractRDM <: SSM2D
An abstract type for the racing diffusion model.
SequentialSamplingModels.AbstractWald
— TypeAbstractWald <: SSM1D
An abstract type for the Wald model.
SequentialSamplingModels.AbstractaDDM
— TypeAbstractaDDM <: SSM2D
An abstract type for the attentional drift diffusion model.
SequentialSamplingModels.AbstractstDDM
— TypeAbstractstDDM <: SSM2D
An abstract type for the starting-time diffusion decision model.
SequentialSamplingModels.CDDM
— TypeCDDM{T<:Real} <: AbstractCDDM
A circular drift diffusion model (CDDM) for continous responding. CCDM is typically applied to continous report of color in visual working memory tasks. Currently supports the 2D case.
Parameters
ν
: a vector drift rates. ν₁ is the mean drift rate along the x-axis; ν₂ is the mean drift rate along the y-axis.σ
: intra-trial drift rate variabilityη
: a vector across-trial standard deviations of drift rates. η₁ is the standard deviation of drift rate along the x-axis; ν₂ is the standard deviation of drift rate along the y-axisα
: response boundary as measured by the radious of a circleτ
: mean non-decision time
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
CDDM(ν, σ, η, α, τ)
The second constructor uses keywords with default values, and is not order dependent:
CDDM(; ν=[1,.5], η=[1,1], σ=1, α=1.5, τ=0.30)
Example
using SequentialSamplingModels
dist = CDDM(;ν=[1,.5], η=[1,1], σ=1, α=1.5, τ=0.30)
data = rand(dist, 10)
like = pdf(dist, data)
loglike = logpdf(dist, data)
References
Smith, P. L. (2016). Diffusion theory of decision making in continuous report. Psychological Review, 123(4), 425.
Smith, P. L., Garrett, P. M., & Zhou, J. (2023). Obtaining Stable Predicted Distributions of Response Times and Decision Outcomes for the Circular Diffusion Model. Computational Brain & Behavior, 1-13.
SequentialSamplingModels.ContinuousMultivariateSSM
— TypeContinuousMultivariateSSM <: ContinuousMultivariateDistribution
An abstract type for continuous multivariate sequential sampling models e.g., a circular drift diffusion model.
SequentialSamplingModels.DDM
— TypeDDM{T<:Real} <: SSM2D
Model object for the standard Drift Diffusion Model.
Parameters
ν
: drift rate. Average slope of the information accumulation process. The drift gives information about the speed and direction of the accumulation of information. Typical range: -5 < ν < 5α
: boundary threshold separation. The amount of information that is considered for a decision. Typical range: 0.5 < α < 2z
: starting point. Indicator of an an initial bias towards a decision. The z parameter is relative to a (i.e. it ranges from 0 to 1).τ
: non-decision time. The duration for a non-decisional processes (encoding and response execution). Typical range: 0.1 < τ < 0.5
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
DDM(ν, α, z, τ)
The second constructor uses keywords with default values, and is not order dependent:
DDM(; ν = 1.00, α = 0.80, τ = 0.30, z = 0.50)
Example
using SequentialSamplingModels
dist = DDM(ν = 1.0, α = 0.8, τ = 0.3, z = 0.25)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
Ratcliff, R., & McKoon, G. (2008). The Diffusion Decision Model: Theory and Data for Two-Choice Decision Tasks. Neural Computation, 20(4), 873–922.
SequentialSamplingModels.ExGaussian
— TypeExGaussian{T<:Real} <: SSM1D
The Ex-Gaussian is a convolution of the Gaussian and exponential distribution sometimes used to model reaction time distributions. Note that this is not technically a sequential sampling model.
Parameters
μ
: mean of Gaussian componentσ
: standard deviation of Gaussian componentτ
: mean of exponential component
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
ExGaussian(μ, σ, τ)
The second constructor uses kewords, and is not order dependent:
ExGaussian(;μ=.5, σ=.20, τ=.20)
Example
using SequentialSamplingModels
dist = ExGaussian(;μ=.5, σ=.20, τ=.20)
rt = rand(dist, 10)
like = pdf.(dist, rt)
loglike = logpdf.(dist, rt)
References
Matzke, D., & Wagenmakers, E. J. (2009). Psychological interpretation of the ex-Gaussian and shifted Wald parameters: A diffusion model analysis. Psychonomic bulletin & review, 16, 798-817.
SequentialSamplingModels.LBA
— TypeLBA{T<:Real} <: AbstractLBA
A model object for the linear ballistic accumulator.
Parameters
ν
: a vector of drift ratesσ
: a vector of drift rate standard deviationA
: max start pointk
: A + k = b, where b is the decision thresholdτ
: a encoding-response offset
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
LBA(ν, σ, A, k, τ)
The second constructor uses keywords with default values, and is not order dependent:
LBA(;τ=.3, A=.8, k=.5, ν=[2.0,1.75], σ=[1.0,1.0])
Example
using SequentialSamplingModels
dist = LBA(ν=[3.0,2.0], A = .8, k = .2, τ = .3)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
Brown, S. D., & Heathcote, A. (2008). The simplest complete model of choice response time: Linear ballistic accumulation. Cognitive psychology, 57(3), 153-178.
SequentialSamplingModels.LCA
— TypeLCA{T<:Real} <: AbstractLCA
A model type for the Leaky Competing Accumulator.
Parameters
ν
: drift ratesσ
: diffusion noiseβ
: lateral inhabitionλ
: leak rateα
: evidence thresholdτ
: non-decision time
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
LCA(ν, σ, β, λ, α, τ)
The second constructor uses keywords with default values, and is not order dependent:
LCA(; ν = [2.5, 2.0], α = 1.5, β = 0.20, λ = 0.10, τ = 0.30, σ = 1.0)
Example
using SequentialSamplingModels
ν = [2.5,2.0]
α = 1.5
β = 0.20
λ = 0.10
σ = 1.0
τ = 0.30
dist = LCA(; ν, α, β, λ, τ, σ, Δt)
choices,rts = rand(dist, 500)
References
Usher, M., & McClelland, J. L. (2001). The time course of perceptual choice: The leaky, competing accumulator model. Psychological Review, 108 3, 550–592. https://doi.org/10.1037/0033-295X.108.3.550
SequentialSamplingModels.LNR
— TypeLNR{T<:Real} <: AbstractLNR
Parameters
ν
: a vector of means in log-spaceσ
: a vector of standard deviation parameter in log-spaceτ
: a encoding-response offset
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
LNR(ν, σ, τ)
The second constructor uses keywords with default values, and is not order dependent:
LNR(; ν = [-1, -2], σ = fill(1.0, length(ν)), τ = 0.20)
Example
using SequentialSamplingModels
dist = LNR(ν=[-2,-3], σ=[1.0,1.0], τ=.3)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
Rouder, J. N., Province, J. M., Morey, R. D., Gomez, P., & Heathcote, A. (2015). The lognormal race: A cognitive-process model of choice and latency with desirable psychometric properties. Psychometrika, 80(2), 491-513.
SequentialSamplingModels.PoissonRace
— TypePoissonRace{T<:Real} <: AbstractPoissonRace
Parameters
ν
: gamma scale parameterα
: thresholdτ
: a encoding-response offset
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
PoissonRace(ν, α, τ)
The second constructor uses keywords with default values, and is not order dependent:
PoissonRace(;ν=[.05,.06], α=[5,5], τ=.3)
Example
using SequentialSamplingModels
dist = PoissonRace(ν=[.05,.06], α=[5,5], τ=.3)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
LaBerge, D. A. (1962). A recruitment model of simple behavior. Psychometrika, 27, 375-395.
SequentialSamplingModels.RDM
— TypeRDM{T<:Real} <: AbstractRDM
An object for the racing diffusion model.
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
RDM(ν, k, A, τ)
The second constructor uses keywords with default values, and is not order dependent:
RDM(;ν=[1,2], k=.3, A=.7, τ=.2)
Parameters
ν
: a vector of drift ratesA
: the maximum starting point diffusion process, sampled from Uniform distributionk
: k = b - A where b is the decision threshold, and A is the maximum starting pointτ
: a encoding-motor time offset
Example
using SequentialSamplingModels
dist = RDM(;ν=[1,2], k=.3, A=.7, τ=.2)
choice,rt = rand(dist, 10)
like = pdf.(dist, choice, rt)
loglike = logpdf.(dist, choice, rt)
References
Tillman, G., Van Zandt, T., & Logan, G. D. (2020). Sequential sampling models without random between-trial variability: The racing diffusion model of speeded decision making. Psychonomic Bulletin & Review, 27, 911-936.
SequentialSamplingModels.SSM1D
— TypeSSM1D <: ContinuousUnivariateDistribution
An abstract type for sequential sampling models characterized by a single choice reaction time distribution. Sub-types of SSM1D
output a vector of reaction times.
SequentialSamplingModels.SSM2D
— TypeSSM2D = Distribution{Multivariate, Mixed}
An abstract type for sequential sampling models characterized by a multivariate choice-reaction time distribution. Sub-types of SSM2D
output a NamedTuple
consisting of a vector of choices and reaction times.
SequentialSamplingModels.Wald
— TypeWald{T<:Real} <: AbstractWald
A model object for the Wald model, also known as the inverse Gaussian model.
Parameters
ν
: drift rateα
: decision thresholdτ
: a encoding-response offset
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
Wald(ν, α, τ)
The second constructor uses keywords with default values, and is not order dependent:
Wald(;ν=1.5, α=.50, τ=0.20)
Example
using SequentialSamplingModels
dist = Wald(ν=3.0, α=.5, τ=.130)
rt = rand(dist, 10)
like = pdf.(dist, rt)
loglike = logpdf.(dist, rt)
References
Anders, R., Alario, F., & Van Maanen, L. (2016). The shifted Wald distribution for response time data analysis. Psychological methods, 21(3), 309.
Folks, J. L., & Chhikara, R. S. (1978). The inverse Gaussian distribution and its statistical application—a review. Journal of the Royal Statistical Society Series B: Statistical Methodology, 40(3), 263-275.
SequentialSamplingModels.WaldMixture
— TypeWaldMixture{T<:Real} <: AbstractWald
Parameters
υ
: drift rateη
: standard deviation of drift rateα
: decision thresholdτ
: a encoding-response offset
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
WaldMixture(ν, η, α, τ)
The second constructor uses keywords with default values, and is not order dependent:
WaldMixture(;ν=3.0, η=.2, α=.5, τ=.130)
Example
using SequentialSamplingModels
dist = WaldMixture(;ν=3.0, η=.2, α=.5, τ=.130)
rt = rand(dist, 10)
like = pdf.(dist, rt)
loglike = logpdf.(dist, rt)
References
Steingroever, H., Wabersich, D., & Wagenmakers, E. J. (2020). Modeling across-trial variability in the Wald drift rate parameter. Behavior Research Methods, 1-17.
SequentialSamplingModels.aDDM
— TypeaDDM{T<:Real} <: AbstractaDDM
An object for the attentional diffusion model.
Parameters
ν
: relative decision values (i.e., drift rates)σ
: standard deviation of noise in evidence accumulationΔ
: constant of evidence accumulation speed (evidence per ms)α
: evidence thresholdz
: initial evidenceθ
: bias towards attended alternative (lower indicates more bias)τ
: non-decision time
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
aDDM(ν, σ, Δ, θ, α, z, τ)
The second constructor uses keywords with default values, and is not order dependent:
aDDM(;ν=[5.0,4.0], α=1.0, z=α*.5, θ=.3, σ=.02, Δ=.0004, τ=0.0)
Example
using SequentialSamplingModels
using StatsBase
mutable struct Transition
state::Int
n::Int
mat::Array{Float64,2}
end
function Transition(mat)
n = size(mat,1)
state = rand(1:n)
return Transition(state, n, mat)
end
function fixate(transition)
(;mat,n,state) = transition
w = @view mat[state,:]
next_state = sample(1:n, Weights(w))
transition.state = next_state
return next_state
end
model = aDDM()
tmat = Transition([.98 .015 .005;
.015 .98 .005;
.45 .45 .1])
choices,rts = rand(model, 100, tmat; fixate)
References
Krajbich, I., Armel, C., & Rangel, A. (2010). Visual fixations and the computation and comparison of value in simple choice. Nature neuroscience, 13(10), 1292-1298.
SequentialSamplingModels.maaDDM
— TypemaaDDM{T<:Real} <: AbstractaDDM
An object for the multi-attribute attentional drift diffusion model.
Constructors
Two constructors are defined below. The first constructor uses positional arguments, and is therefore order dependent:
maaDDM(ν, σ, Δ, θ, ϕ, ω, α, z, τ)
The second constructor uses keywords with default values, and is not order dependent:
maaDDM(;
ν = [4.0 5.0; 5.0 4.0],
α = 1.0,
z = 0.0,
θ = 0.3,
ϕ = 0.50,
ω = 0.70,
σ = 0.02,
Δ = 0.0004,
τ = 0.0,
)
In this version of the model, the non-attended attribute of the non-attended alternative is doubly discounted. For example, the mean drift rate for the attribute 1 of alternative 1 is given by:
Δ * (ω * (ν[1,1] - θ * ν[2,1]) + (1 - ω) * ϕ * (ν[1,2] - θ * ν[2,2]))
Keywords
ν
: drift rates where rows are alternatives and columns are attributesσ
: standard deviation of noise in evidence accumulationΔ
: constant of evidence accumulation speed (evidence per ms)θ
: bias away from unattended alternative (lower indicates more bias)ϕ
: bias away from unattended attributeω
: attribute weightα
: evidence thresholdz
: initial evidenceτ
: non-decision time
Example
using SequentialSamplingModels
using StatsBase
mutable struct Transition
state::Int
n::Int
mat::Array{Float64,2}
end
function Transition(mat)
n = size(mat,1)
state = rand(1:n)
return Transition(state, n, mat)
end
function attend(transition)
(;mat,n,state) = transition
w = @view mat[state,:]
next_state = sample(1:n, Weights(w))
transition.state = next_state
return next_state
end
ν = [4.0 5.0; 5.0 4.0]
α = 1.0
z = 0.0
θ = .3
ϕ = .50
ω = .70
σ = .02
Δ = .0004
τ = 0.0
dist = maaDDM(; ν, σ, Δ, θ, ϕ, ω, α, z, τ)
tmat = Transition([.98 .015 .0025 .0025;
.015 .98 .0025 .0025;
.0025 .0025 .98 .015;
.0025 .0025 .015 .98])
choices,rts = rand(dist, 100, attend, tmat)
References
Yang, X., & Krajbich, I. (2023). A dynamic computational model of gaze and choice in multi-attribute decisions. Psychological Review, 130(1), 52.
Base.rand
— Methodrand(dist::AbstractLCA, n_sim::Int; Δt = 0.001)
Generate n_sim
random choice-rt pairs for the Leaky Competing Accumulator.
Arguments
dist
: model object for the Leaky Competing Accumulator.n_sim::Int
: the number of simulated choice-rt pairs
Keywords
Δt = 0.001
: time step size
Base.rand
— Methodrand(dist::AbstractLCA; Δt = 0.001)
Generate a random choice-rt pair for the Leaky Competing Accumulator.
Arguments
dist
: model object for the Leaky Competing Accumulator.Δt = 0.001
: time step size
Base.rand
— Methodrand(
rng::AbstractRNG,
dist::AbstractaDDM,
n_sim::Int,
fixate::Function,
args...;
rand_state! = _rand_state!,
Δt = .001,
kwargs...
)
Generate n_sim
simulated trials from the attention diffusion model.
Arguments
rng
: a random number generatordist
: an attentional diffusion model objectn_sim::Int
: the number of simulated trialsfixate
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2args...
: optional positional arguments for thefixate
function
Keywords
rand_state! = _rand_state!
: initialize first state with equal probability
kwargs...
: optional keyword arguments for thefixate
functionΔt = .001
: time step
Base.rand
— Methodrand(
rng::AbstractRNG,
dist::AbstractaDDM,
fixate::Function, args...;
rand_state! = _rand_state!,
Δt = .001,
kwargs...
)
Generate a single simulated trial from the attentional diffusion model.
Arguments
rng
: a random number generatordist
: an attentional diffusion model objectfixate
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2args...
: optional positional arguments for thefixate
function
Keywords
kwargs...
: optional keyword arguments for thefixate
functionΔt = .001
: time step
Base.rand
— Methodrand(dist::AbstractstDDM)
Generate a random choice-rt pair for starting-time diffusion decision model.
Arguments
rng
: a random number generatordist
: model object for the starting-time diffusion decision model.Δt
: time-step for simulation
Base.rand
— Methodrand(dist::DDM)
Generate a random rt for the Diffusion Decision Model (negative coding)
Arguments
dist
: model object for the Diffusion Decision Model.
Base.rand
— Methodrand(rng::AbstractRNG, d::SSM2D, N::Int; kwargs...)
Default method for Generating n_sim
random choice-rt pairs from a sequential sampling model with more than one choice option.
Arguments
d::SSM2D
: a 2D sequential sampling model.n_trials::Int
: the number of simulated choices and rts
Keywords
kwargs...
: optional keyword arguments
Distributions.cdf
— Functioncdf(d::SSM2D, choice::Int, ub=10)
Computes the cumulative density for a given choice. The cumulative density is based on an analytic formula, a numeric integration of pdf
, or Monte Carlo simulation, depending on which is available for a given model.
Arguments
d::SSM2D
: a 2D sequential sampling model.choice::Int
: the number of simulated choices and rtsub=10
: upper bound of integration
Distributions.cdf
— Methodcdf(
rng::AbstractRNG,
d::AbstractaDDM,
choice::Int,
fixate::Function,
ub,
args...;
n_sim=10_000,
kwargs...
)
Computes the approximate cumulative probability density of AbstractaDDM
using Monte Carlo simulation.
Arguments
dist
: an attentional diffusion model objectchoice
: the choice on which the cumulative density is computedfixate
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2ub::Int
: the upper bound of the integralargs...
: optional positional arguments for thefixate
function
Keywords
n_sim::Int
=10_000: the number of simulated trials
rand_state! = _rand_state!
: initialize first state with equal probability
kwargs...
: optional keyword arguments for thefixate
function
Distributions.cdf
— Methodcdf(d::SSM1D, choice::Int, ub=10)
Computes the cumulative density for a given choice. The cumulative density is based on an analytic formula, a numeric integration of pdf
, or Monte Carlo simulation, depending on which is available for a given model.
Arguments
d::SSM1D
: a 1D sequential sampling model.ub
: upper bound of integration
Distributions.logpdf
— Methodlogpdf(d::SSM2D, data::NamedTuple)
Computes the likelihood for a 2D sequential sampling model.
Arguments
d::SSM2D
: an object for a 2D sequential sampling modeldata::NamedTuple
: a NamedTuple of data containing choice and reaction time
Distributions.pdf
— Methodpdf(d::SSM2D, data::NamedTuple)
Computes the probability density for a 2D sequential sampling model.
Arguments
d::SSM2D
: an object for a 2D sequential sampling modeldata::NamedTuple
: a NamedTuple of data containing choice and reaction time
SequentialSamplingModels.compute_choice_probs
— Methodcompute_choice_probs(data::NamedTuple; choice_set=unique(data.choice))
Returns the choice probabilities for a 2D SSM.
Arguments
data::NamedTuple
: a data structure containing discrete choices in the keychoice
and corresponding
reaction times in key rt
Keywords
- `choice_set: a vector of possible choices.
SequentialSamplingModels.compute_quantiles
— Methodcompute_quantiles(data::Array{<:Real,2}; percentiles=.1:.1:.90)
Returns the marginal quantiles for a continous multivariate SSM.
data::Array{<:Real,2}
: an array of continous observations
Keywords
percentiles=.1:.1:.90
: percentiles at which to evaluate the quantiles
SequentialSamplingModels.compute_quantiles
— Methodcompute_quantiles(data::NamedTuple; choice_set=unique(data.choice), percentiles=.1:.1:.90)
Returns the quantiles for each choice of a 2D SSM. Note there is a chance that a given choice will have no observations, and thus no quantiles. Such cases will need to be removed or handled in post processing.
Arguments
data::NamedTuple
: a data structure containing discrete choices in the keychoice
and corresponding
reaction times in key rt
Keywords
percentiles=.1:.1:.90
: percentiles at which to evaluate the quantileschoice_set=unique(choice)
: a vector of possible choices.
SequentialSamplingModels.compute_quantiles
— Methodcompute_quantiles(data::Vector{<:Real}; percentiles=.1:.1:.90)
Returns the quantiles associated with a vector of reaction times for a single choice SSM.
data::Vector{<:Real}
: a vector of reaction times
Keywords
percentiles=.1:.1:.90
: percentiles at which to evaluate the quantiles
SequentialSamplingModels.n_options
— Methodn_options(dist::DDM)
Returns 2 for the number of choice options
Arguments
d::DDM
: a model object for the drift diffusion model
SequentialSamplingModels.n_options
— Methodn_options(dist::SSM2D)
Returns the number of choice options based on the length of the drift rate vector ν
.
Arguments
d::SSM2D
: a sub-type ofSSM2D
SequentialSamplingModels.n_options
— Methodn_options(dist::SSM1D)
Returns 1 for the number of choice options
Arguments
d::SSM1D
: a sub-type ofSSM1D
SequentialSamplingModels.simulate
— Methodsimulate(model::AbstractCDDM; Δt=.001)
Returns a matrix containing evidence samples of the racing diffusion model decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::AbstractCDDM;
: a circular drift diffusion model object
Keywords
Δt=.001
: size of time step of decision process in seconds
SequentialSamplingModels.simulate
— Methodsimulate(model::AbstractLCA; _...)
Returns a matrix containing evidence samples of the LCA decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::AbstrctLCA
: an LCA model object
SequentialSamplingModels.simulate
— Methodsimulate(model::AbstractPoissonRace; _...)
Returns a matrix containing evidence samples of the LBA decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::AbstractLBA
: a subtype of AbstractLBA
Keywords
n_steps=100
: number of time steps at which evidence is recorded
SequentialSamplingModels.simulate
— Methodsimulate(model::AbstractLBA; n_steps=100)
Returns a matrix containing evidence samples of the LBA decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::AbstractLBA
: a subtype of AbstractLBA
Keywords
n_steps=100
: number of time steps at which evidence is recorded
SequentialSamplingModels.simulate
— Methodsimulate(model::AbstractRDM)
Returns a matrix containing evidence samples of the racing diffusion model decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::AbstractRDM
: an racing diffusion model object
Keywords
Δt=.001
: size of time step of decision process in seconds
SequentialSamplingModels.simulate
— Methodsimulate(
rng::AbstractRNG,
model::AbstractaDDM;
fixate,
args=(),
kwargs=(),
Δt = .001,
rand_state! = _rand_state!
)
Returns a matrix containing evidence samples from a subtype of an attentional drift diffusion model decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
rng::AbstractRNG
: random number generatormodel::AbstractaDDM
: an drift diffusion model object
Keywords
fixate
: a function of the visual fixation process which returns 1 for alternative and 2 for alternative 2args=()
: a set of optional positional arguments for theattend
functionkwargs=()
: a set of optional keyword arguments for theattend
functionΔt = .001
: time step
rand_state! = _rand_state!
: initialize first state with equal probability
SequentialSamplingModels.simulate
— Methodsimulate(rng::AbstractRNG, model::AbstractstDDM; Δt)
Returns a matrix containing evidence samples of the stDDM decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
rng
: a random number generatormodel::AbstractstDDM
: a starting-time diffusion decision model diffusion model objectΔt
: time-step for simulation
SequentialSamplingModels.simulate
— Methodsimulate(model::DDM; Δt=.001)
Returns a matrix containing evidence samples of the drift diffusion model decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::DDM
: an drift diffusion model object
Keywords
Δt=.001
: size of time step of decision process in seconds
SequentialSamplingModels.simulate
— Methodsimulate(model::WaldMixture; Δt=.001)
Returns a matrix containing evidence samples of the Wald mixture decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::Wald
: an Wald mixture model object
Keywords
Δt=.001
: size of time step of decision process in seconds
SequentialSamplingModels.simulate
— Methodsimulate(model::Wald; Δt=.001)
Returns a matrix containing evidence samples of the Wald decision process. In the matrix, rows represent samples of evidence per time step and columns represent different accumulators.
Arguments
model::Wald
: an Wald model object
Keywords
Δt=.001
: size of time step of decision process in seconds
StatsAPI.loglikelihood
— Methodloglikelihood(d::SSM2D, data::NamedTuple)
Computes the summed log likelihood for a 2D sequential sampling model.
Arguments
d::SSM2D
: an object for a 2D sequential sampling modeldata::NamedTuple
: a NamedTuple of data containing choice and reaction time