Unfold.AbstractModelFit
โ TypeAbstract Type to report modelresults
Unfold.BasisFunction
โ TypeSee FIRBasis for an examples
a BasisFunction should implement:
kernel() # kernel(b::BasisFunction,sample) => returns the designmatrix for that event
height() # number of samples in continuous time, NaN if not defined
width() # number of coefficient columns (e.g. HRF 1 to 3, FIR=height(),except if interpolate=true )
colnames() # unique names of expanded columns
times() # vector of times along expanded columns, length = height()
name() # name of basisfunction
collabel() [default "colname_basis"] # name for coeftable
shift_onset() [default 0]
Unfold.DesignMatrixLinearModel
โ TypeDesignMatrix
Type that keeps an Array of formulas
, designmatrices modelmatrix
(Array or Array of Arrays in case of MixedModel) and events
-dataframe
Unfold.FIRBasis
โ TypeDefines a FIRBasisfunction which can be called for each event, defining the time-expanded basis kernel
mutable struct FIRBasis <: Unfold.BasisFunction
times
: vector of times along rows of kernel-output (in seconds)name
: name of the event, should be the actual eventName ineventcolumn
of the dataframes latershift_onset
: by how many samples do we need to shift the event onsets? This number is determined by how many 'negative' timepoints the basisfunction definesinterpolate
: should we linearly interpolate events not on full samples?scale_duration
: should we scale kernel to the duration? If yes, with which method
(tipp: most users would you want to call firbasis, not generate it manually)
Examples
julia> b = FIRBasis(range(0,1,length=10),"basisA",-1)
Unfold.LinearModelFit
โ TypeContains the results of linearmodels (continuous and not)
Unfold.TimeExpandedTerm
โ TypeObject with a term and an applicable BasisFunction and a eventfield that are later passed to the basisfunction.
struct TimeExpandedTerm{T<:StatsModels.AbstractTerm} <: StatsModels.AbstractTerm
term
: Term that the basis function is applied to. This is regularly called in other functions to get e.g. term-coefnames and timeexpand thosebasisfunction
: Kernel that determines what should happen to the designmatrix of the termeventfields
: Which fields of the event-table should be passed to the basisfunction.Important: The first entry has to be the event-latency in samples!
Examples
julia> b = TimeExpandedTerm(term,kernel,[:latencyTR,:durationTR])
Unfold.UnfoldLinearModel
โ TypeConcrete type to implement an Mass-Univariate LinearModel. .design
contains the formula + times dict .designmatrix
contains a DesignMatrix
modelfit
is a Any
container for the model results
Unfold.UnfoldLinearModelContinuousTime
โ TypeConcrete type to implement an deconvolution LinearModel. .design
contains the formula + times dict .designmatrix
contains a DesignMatrix
modelfit
is a Any
container for the model results
Unfold.UnfoldModel
โ Typeusing Base: @deprecate_binding The main abstract model-type of the toolbox. E.g. UnfoldLinearModel
is a concrete type of this