unfoldtoolbox / Unfold.jl

Neuroimaging (EEG, fMRI, pupil ...) regression analysis in Julia
MIT License
48 stars 10 forks source link

Refactor predict + add predicttable #154

Closed behinger closed 7 months ago

behinger commented 11 months ago

@ReneSkukies all yours :)

What do we want?

Climatejustice!

rename stuff

"standard" predict

  1. $\hat{y} =Xb$ => epoched
  2. $\hat{y} =X{dc}b{dc}$ => continuous data predict(m;type=:only_epoch) / predict(m::TimeContinuous;type=:continuous)

predict new data

$\hat{y} = X_{new}b$ => epoched and continuous data predict(m,DataFrame(:continuous=[1,2],:categorical["A","B"]) => always no overlap

new stuff

residuals(m,data) = data .- predict(m)

"event-based" predict

$\hat{y}$ but you have case (2), but want results only around certain latencies $\pm$, so case (1) predict(m::TimeContinuous,latencies,tau) & predict(m::TimeContinuous,evts::DataFrame,tau) & predict(m::TimeContinuous,:basisname/eventname) predict(m::TimeContinuous;type=:epoch) == predict.(m,:basisnames/eventnames)

=> full overlap

predicttable

predicttable => wrapper around predict, returns an effects-output-style DataFrame

partial overlap

predict(m,exclude=[:eventnameA]) => put all other coefficients to 0 and call predict(X,b) => some overlap predict(m,include=[:eventnameA])

Stimulus,Fixations,Fixation,Fixation

I want: