-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented extract coefs
function
#4
Conversation
benchmark/sim_and_fit.jl
Outdated
multichannel_signal = | ||
MultichannelComponent(signal, projection[channels, source_idx], NoNoise()) | ||
return multichannel_signal | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
end | |
end |
benchmark/types.jl
Outdated
ChannelStyle(::Type{UnitTestSimulation}) = MultiChannel() | ||
|
||
EventStyle(::Type) = SingleEventType() | ||
EventStyle(::Type{UnitTestSimulation}) = MultipleEventTypes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
EventStyle(::Type{UnitTestSimulation}) = MultipleEventTypes() | |
EventStyle(::Type{UnitTestSimulation}) = MultipleEventTypes() |
src/extract_coefs.jl
Outdated
coefs_all_subjects = cat(coefs_vector..., dims = ndims(coefs_vector[1]) + 1)#::Array{<:Union{<:Missing,<:Float64},4} | ||
|
||
return coefs_all_subjects | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
end | |
end |
test/extract_coefs.jl
Outdated
).estimate | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
end | |
end |
test/setup.jl
Outdated
using StableRNGs | ||
|
||
include("../benchmark/types.jl") | ||
include("../benchmark/sim_and_fit.jl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
include("../benchmark/sim_and_fit.jl") | |
include("../benchmark/sim_and_fit.jl") |
""" | ||
extract_coefs(model::UnfoldModel, predictor, basisname) | ||
|
||
Return the coefficients of an Unfold model for a certain `predictor` and `basisname`. | ||
|
||
For extracting the terms of a predictor variable `predictor` must be a symbol e.g. :continuous. | ||
For extracting the intercept `predictor` should be a String, i.e. "(Intercept)". | ||
|
||
`basisname` must match one of the basis names which can be found in `coeftable(model)`. | ||
|
||
Note: If a predictor variable has more than one term in the formula (e.g. a spline set, a categorical variable with several levels or an interaction), | ||
the coefficients for all terms are returned. | ||
|
||
The dimensions of the returned coefficients are channel x times x coefficients. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@behinger Could you have a short look at the docstrings for the extract_coefs
function and its methods and tell me whether they make sense or whether you would adapt them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice!
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
extract_coefs
function to extract the coefficients of a fitted UnfoldModel for a certain predictor variable and event type (also added tests & docstrings)define_simulation
andsim_and_fit
functions to simulate multi-subject data usingUnfoldSim
and fit Unfold models for all subjects. (tests & docstrings are still missing) (I used traits to make simulating & model fitting more modular)