pillowlab / neuroglm Goto Github PK
View Code? Open in Web Editor NEWFitting and analysis of trial-based neural spike responses with Generalized Linear Model (GLM).
License: MIT License
Fitting and analysis of trial-based neural spike responses with Generalized Linear Model (GLM).
License: MIT License
Have unsuccessfully tried to run tutorial.m
, seemingly because it is unclear what fitGLM
and buildGLM.buildModel
resolve to.
Lines 120 to 130 in e603491
Line 130 references an unresolved model
variable that seems to be set in the previously commented L121-L126.
Uncommenting the commented lines is also funky:
buildGLM.buildModel
does not existfitGLM
I assume should exist under buildGLM
but it does not. Currently it conflicts with Matlab's inbuilt fitglm
Giving a quick look through the available source in this repo neuroGLM\matRegress\+glms\autoFitGLM.m
is the closest to actually returning a model, but does not seem to match the function call in L130?
Lines 136 to 141 in e603491
Afterwards I imagine generatePrediction
, simulateModel
, goodnessOfFit
, visualizeGoodnessOfFit
would also be unresolved as I cannot find anything with those names in the repo.
Am I missing something obvious? The docs/tutorial.md
does seem to suggest another approach using the dm
matrix that I can explore further, but I was expecting the tutorial to work in the first instance regardless.
Lines 185 to 186 in e603491
Hi,
I have been looking for models that allow to correlate neural activity to behavioral variables and found this repository.
As I see this only refers to spike train data, but do you think it is possible to use this code with calcium data? Would be previous spike deconvolution from the calcium imaging data necessary before using it? Thanks in advance and sorry for the very basic question.
Eduardo Maristany
--- This is a question, not an issue ---
For evaluating the goodness-of-fit of the model, it is useful to generate predictions that MARGINALIZE over all possible spike histories. That is, having fit the model to an observed spike train, one wants to evaluate how well it can explain the data without using the observed spike train as the spike history of the model. Otherwise, things become a bit circular. Anyone written code for this? Thanks!
Illustrating the overall process from start to end.
At some point, we need to make sure 'master' branch contains a publicly usable code. All developments should be merging to the dev branch only.
Memming will announce a procedure to do this switch. This will require that everybody who cloned this repo needs to do a renaming as well.
Whats the advice if my spike train or timing variables are empty during some of the trials?
Sidenote:
To get my data accepted by the addTrial, function I added a condition to only test that the timing of events happen within the duration of the trial if the data input is nonempty. (The tests in line 18 and 28 does not work on empty vectors)
Then, when I compiled the SparseDesignMatrix it gave me a warning that the design matrix contains infs and nans. Could that be due to empty timing vectors?
Those columns are useless for prediction, and completely collinear, redundant with bias term.
Make sure to keep the indices, so one can reconstruct the original form.
The function buildGLM.addCovariateSpiketrain
might have a bug. It forces the offset to be 1 (line 11), disregarding the value in the basisStruct and without taking into account the unit of time or the bin size used.
For example, if the unit of time is set to be seconds, the offset will be forced to be 1 second.
Or, if another offset value has been set using basis functions, it will not be considered.
A solution to this issue could be:
% offset = 1; % Make sure to be causal. No instantaneous interaction allowed.
offset = basisStruct.param.nlOffset;
Hi all,
This is not exactly a problem with the software, but rather a general analysis question.
In our acute recordings we often have drift that leads to units appearing and disappearing during a recording session. That means that there is a set of units that were recorded in all trials but also a set of units that have limited, not necessarily overlapping, "lifetimes".
How would I deal with these unstable neurons? I cannot simply leave the spike trains for these units empty outside their lifetimes, since the unit is not merely silent but is not recorded from.
As a side note: is this repo still being maintained or should I switch to pillowlab/GLMspiketools?
Thanks, Daniel
When I run the tutorial.m file the two spike filters 'hist' and 'coupling' both approach 0 towards long lags. If you interpret the filters as a kind of gain that would mean that 243 ms after a spike the spike rate goes down to 0. Does that make sense or should those filters be shifted by 1?
I have the same issue if I run the code on my data.
If you look at Park et al. 2014 the filters all seem to approach 1 instead. That seems to make more sense to me.
Hi,
I am trying use this package on my data but for one trial I get an error due to the exp.binfun function.
It calculates the number of bins by dividing duration of trial with experiment binsize, and gives the right result compared to the number of samples in my behavior vector, for example, my vector is 251 elements, and duration/binSize = 251.00000... However, due to the ceil function it gets rounded up to 252 (The diff from 251 is 2.8422e-14).
I run into the same problem in line 14 of compileSparseDesignMatrix.
Is there any reason for using ceil instead of round?
Best regards, Eivind Hennestad
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.