unfoldtoolbox / UnfoldSim.jl

Simulate EEG / ERP data with overlap, non-linear effects, multiple regression
MIT License
7 stars 4 forks source link

abstractDesign, lot's of changes #7

Closed behinger closed 1 year ago

behinger commented 1 year ago

ExperimentDesign -> MultiSubjectDesign <: AbstractDesign Component => Component <: AbstractComponent (should be renamed MultiSubjectComponent likely)

noise is now actually added (t'was not a inplace operation after all..)

sort! in ExperimentDesign-generate is removed. I added a tableModifyFun => e.g. allows for shuffling.

To keep the order of subject in place, I sort afterwards only for subject.

-> oh wow, not that many changes after all!

behinger commented 1 year ago

I rewrote the convert function, it now simply appends the onsets as latency column to the generate(design) event table. I think that should be enough (o.c. after pushing latency of later subjects accordingly). We could think of returning this by default (not the data,onsets but data,events)

behinger commented 1 year ago

I am now thinking of how to refactor the sim_eeg function & components.

@kw_args struct MixedModelComponent <: AbstractComponent
     signal
     formula
     \beta::Vector
     \sigmas::Vector
     contrasts::Dict = Dict()
end

@kw_args struct LinearModelComponent <: AbstractComponent
     signal
     formula
     \beta::Vector
     contrasts::Dict = Dict()
end

These seem a bit narrow termed, e.g. we don't allow to provide other arguments to the LM/LMM functions (but I also couldnt think of any, maybe weights?). They also dont allow for Variance changes - but maybe we should then ask to implement their own Component + Simulation function.

I think Design + generate and Component + simulate could work well, but the function names, do they really reflect what happens here?