Code Monkey home page Code Monkey logo

unmixed's Introduction

Abandoned

This project is abandoned - I would not recommend using it. I'd much rather recommend helping in developung Unfold.jl which has already support for MixedModels, albeit with some problems on realistic models (2021-11-09)

Disclaimer:

This extension is still being developed and needs optimization for speed and additional tests. Use at your own risk!. Probably best to contact me prior to using it to get to know the quirks :-)

Unfold + Mixed Models = unmixed

Deconvolution, non linear modeling and Mixed Modeling toolbox

Specify y~1 + A + (1 + A|subject) + (1+C|image) Item and Subject Effects!

Install

git clone https://github.com/behinger/unmixed
git submodule update --init --recursive

Minimal Example:

rng(1)
input = [];
for k = 1:30
    % you can also add item effects by the adding the flag 'randomItem', 1
    % in simulate_data_lmm. The betas / thetas are currently hardcoded because I'm lazy
    input{k} = simulate_data_lmm('noise',10,...
        'srate',50,'datasamples',600*50,...
        'basis','dirac');
end


EEG = um_designmat(input,'eventtypes','fixation','formula','y~1+A+(1+A|subject)');

EEG= um_timeexpandDesignmat(EEG,'timelimits',[-0.1,0.5]);

% Currently I recommend the bobyqa optimizer. Seems to be faster
model_fv = um_mmfit(EEG,input,'channel',1,'optimizer','bobyqa','covariance','FullCholeksy'); % Todo: Directly read covariance from formula like lme4

unmixed's People

Contributors

behinger avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

baalint

unmixed's Issues

Spline-penalizing using mixed effects

Currently trying to figure out how onewould penalize the splines using a random effect

Verbyla 1999 introduces this
https://rss.onlinelibrary.wiley.com/doi/pdf/10.1111/1467-9876.00154

a possible way how to splice it in is presented in the smespline package in R, which uses lme with a specific random effects matrix that I don't understand. Probably we have to rebuild this matrix in "Z", but this seems complicated.

I started with something, but I will probably drop this for now.

Simulations

We need to find out the runtimes of various designs. I start with two, other ideas?

Todo:

  • Add brown noise. I like this: step(dsp.ColoredNoise(2,EEG.npnts))
  • Filter @ 0.1Hz

Basic 2x2 Design

  • 2x2 design (=> 4 parameters),
  • 30 subjects
  • 50min a 100 (250) Hz
  • 2-3 events / s (to make overlap useful ;-)
  • timewindow of 1s [-0.1 - 0.9]

Two conditions and spline

  • 1x2 design + 1 spline
  • 30 subjects
  • 50min a 100 (250) Hz
  • 2-3 events / s (to make overlap useful ;-)
  • timewindow of 1s [-0.1 - 0.9]

add boundary-event support in unfold

Because currently we concatenate the EEG data in unmixed, we need to introduce boundary events between subjects so that the overlap is not over subjects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.