pillowlab / neuroGLM

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

zscoring and offset #6

Closed jcbyts closed 9 years ago

jcbyts commented 9 years ago

Binning and offsetting to make coupling (and history) filters causal the way we were doing it somehow got rid of the refractory period in cells that had clear refractory periods. I think that the offset needs to be implemented before the binning (which rounds).

When combining weights, we have to account for zscoring the bias term.

memming commented 9 years ago

You are adding a binsize width before binning, AND also adding offset = 1? You sure this is correct? For history filter, if the offset is a positive integer, binning before adding or after doesn't matter. In general round(x + 1) == round(x) + 1. I don't understand why refractory period would go away.

jcbyts commented 9 years ago

I agree that offset = 1 should not be necessary after shifting time. As for the binning before or after being the same, it doesn't work out that way. Binning before offsetting is problematic (empirically). It makes the min difference in spike times equal 1, which is neighboring bins (ie. no refractory period). The real min ISI for this cell is 1.45 ms, so something about the binning does not work. I tried all sorts of combinations of round, floor and ceil and I get this problem no matter what. Maybe when you get back from Cosyne, we can look into it?

On Tue, Mar 3, 2015 at 11:01 AM, Il Memming Park notifications@github.com wrote:

You are adding a binsize width before binning, AND also adding offset = 1? For history filter, if the offset is a positive integer, binning before adding or after doesn't matter. In general round(x + 1) == round(x) + 1. I don't understand why refractory period would go away.

Reply to this email directly or view it on GitHub https://github.com/pillowlab/neuroGLM/pull/6#issuecomment-76986581.

memming commented 9 years ago

Sure. That's an important matter. You should make it an "Issue". Pull request is for pulling tested code only. The z-score edit contribution should be merged, so please split this merge request and resubmit.

jcbyts commented 9 years ago

Well, the code I pull requested works :P

I get nice looking history filters that capture the autocorrelation. That's why I pull requested. I'll switch it to an issue and we can figure it out after cosyne.

On Tue, Mar 3, 2015 at 11:11 AM, Il Memming Park notifications@github.com wrote:

Sure. That's an important matter. You should make it an "Issue". Pull request is for pulling tested code only. The z-score edit contribution should be merged, so please split this merge request and resubmit.

Reply to this email directly or view it on GitHub https://github.com/pillowlab/neuroGLM/pull/6#issuecomment-76988720.

memming commented 9 years ago

Well, you're shifting things by 2 bins. I don't see why this should work. Maybe we should test it when there's no refractory period. Yeah, let's discuss this after COSYNE.