pillowlab / neuroGLM

Fitting and analysis of trial-based neural spike responses with Generalized Linear Model (GLM).
MIT License
68 stars 38 forks source link

marginalizing across spike histories #13

Open agbondy opened 5 years ago

agbondy commented 5 years ago

--- 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!

jpillow commented 5 years ago

The simplest way is to just simulate repeated responses to the same stimulus, and calculate the mean (i.e. PSTH). That represents a prediction of spike rate conditioned on stimulus (with spike history marginalized out); this is what we did in eg Pillow et al 2008.

agbondy commented 5 years ago

Thanks for the quick reply, Jonathan! Yes, this is basically what I was imagining doing but hoping not to have to write the code myself ;)