Skip to content

Conversation

@behinger
Copy link
Member

@behinger behinger commented Aug 9, 2024

New Features:

  • Onsets can now follow formulas based on the design
  • Components can now have arbitrary vector returning functions depending on the design instead of fixed arrays
  • new SequenceDesign which allows for fixed sequences e.g. Stimulus - Decision - Response, or Stim - Fix - Fix - Fix etc.
  • updated docs due to JOSS
  • EffectsDesign for calculating marginalized effects of a simulation. Can be used to obtain ground truth data. (PR Add EffectsDesign #112) by @ReneSkukies
  • Offsets for components

@jschepers I think I added unittests for all new features + docstrings + tutorials


commit list

  • FormulaOnsets
  • initial sequence tryout
  • fix bug in predef_eeg
  • fix \beta missing
  • forgot the end
  • half way through to success for sequence designs or something
  • everythinig except sequencelength seems to be working now
  • added string sequence tests
  • small doc update
  • added jitter to the '_' trial divisor
  • generalized LinearModelComponent to arbitrary functions instead of vectors
  • bugfix with endless loop due to multiple dispatch
  • function component for multi-subject
  • forgot to define offset in LinearModelFunction
  • Improve documentation especially quickstart, home and power analysis
  • adapted the order of reference overviews and adapted titles
  • Updated quickstart page
  • minor changes
  • fixed docstrings for predef_eeg and predef_2x2
  • added draft of design types reference page
  • Update quickstart.jl
  • Add UnfoldSim logo to the documentation
  • Finished experimental design reference page
  • Replace logo file
  • Update logo file
  • Delete docs/src/assets/logo.svg
  • Add logo as png file
  • Added intro paragraph for Simulate ERP tutorial
  • Improved docstrings for single- and multi-subject design
  • Fixed simulate docstring
  • Added cross references in docstrings
  • Added intro sentences, matched titles and sidebar, reordered pages and added collapsible setup blocks
  • Update noise.jl
  • Update src/noise.jl
  • Update src/noise.jl
  • Update src/noise.jl
  • add empty line for formatting reasons
  • Update docs/literate/reference/noisetypes.jl
  • Update docs/literate/reference/overview.jl
  • Update docs/literate/reference/overview.jl
  • Update docs/literate/reference/noisetypes.jl
  • added docstring
  • renamed to have the formula at the end

behinger and others added 4 commits June 12, 2025 20:30
Co-authored-by: Judith Schepers <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Comment on lines +165 to +166
)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
)
)
),
),

# add to every stepsize onset the maxlength of the response
#@debug onsets[stepsize:stepsize:end]
@debug stepsize
onsets[stepsize+1:stepsize:end] .+= 2 .* maxlength(simulation.components)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
onsets[stepsize+1:stepsize:end] .+= 2 .* maxlength(simulation.components)
onsets[(stepsize+1):stepsize:end] .+= 2 .* maxlength(simulation.components)

comb = vcat(gt_effects, ef)
plot_erp(comb; mapping = (; color = :type, col = :condition))

# The simulated ground truth marginal effects, and the fitted marginal effects look similar as expected, but the fitted has some additional noise because of finite data (also as expected). No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# The simulated ground truth marginal effects, and the fitted marginal effects look similar as expected, but the fitted has some additional noise because of finite data (also as expected).
# The simulated ground truth marginal effects, and the fitted marginal effects look similar as expected, but the fitted has some additional noise because of finite data (also as expected).

axislegend(ax)
f

# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.
# Voila - the inter-onset intervals are `20` samples longer for condition `B`, exactly as specified.

off = get_offset(component) - minoffset(simulation.components)


@views epoch_data[1+off:length(component)+off, :] .+=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@views epoch_data[1+off:length(component)+off, :] .+=
@views epoch_data[(1+off):(length(component)+off), :] .+=

@debug "3D Array"
@views epoch_data[:, 1:length(c), :] .+= simulate_component(rng, c, simulation)
off = get_offset(component) - minoffset(simulation.components)
@views epoch_data[:, 1+off:length(component)+off, :] .+=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@views epoch_data[:, 1+off:length(component)+off, :] .+=
@views epoch_data[:, (1+off):(length(component)+off), :] .+=

o.offset_β

return Int.(
round.(reduce(vcat, rand.(deepcopy(rng), range.(offsets, offsets .+ widths), 1)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
round.(reduce(vcat, rand.(deepcopy(rng), range.(offsets, offsets .+ widths), 1)))
round.(reduce(vcat, rand.(deepcopy(rng), range.(offsets, offsets .+ widths), 1))),

e,
s,
one_onset:one_onset+max_length_component-1,
one_onset+minoffset(simulation.components):one_onset+max_length_component-1+maxoffset(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
one_onset+minoffset(simulation.components):one_onset+max_length_component-1+maxoffset(
(one_onset+minoffset(simulation.components)):(one_onset+max_length_component-1+maxoffset(

one_onset:one_onset+max_length_component-1,
one_onset+minoffset(simulation.components):one_onset+max_length_component-1+maxoffset(
simulation.components,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
),
)),

test/sequence.jl Outdated
)
s, e = simulate(design, c, NoOnset(); return_epoched = true)
@test size(s) == (40, 6)
end No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants