unfoldtoolbox / UnfoldSim.jl

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

Design should allow true continuous predictors #31

Open behinger opened 8 months ago

behinger commented 8 months ago

right now we can only do pseudo-continuous via discretizing [1,2,3,4,5] - would be good to have real continuous sampling ability

behinger commented 5 months ago

Maybe we can create a pull request to MixedModelsSim with the interface to provide a Distribution.jl object from MixedModelsSim would then sample from?

something like Dict(:condition = ["A","B"],:continuous => Uniform(10,20))

behinger commented 5 months ago

Adding this to mixedModelsSim might not be really useful, as they try to make a balanced design. So Judith and I came up with following idea: Yet another design!

struct AddSaccadeAmplitudeDesign4{T} <: AbstractDesign
    design::T
    colname::Symbol
    dist::Distribution
    rng::Any
end
function generate_events(d::AddSaccadeAmplitudeDesign4)
    df = generate_events(d.design)
    df[!, d.colname] .= rand(d.dist, size(df, 1))
    return df
end

design = UnfoldSim.AddSaccadeAmplitudeDesign4(design,:rt,Normal(0,1),MersenneTwister(1))
generate_events(design)