Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset of spike train forced to 1 #14

Open
lachioma opened this issue May 11, 2020 · 3 comments
Open

Offset of spike train forced to 1 #14

lachioma opened this issue May 11, 2020 · 3 comments

Comments

@lachioma
Copy link
Contributor

lachioma commented May 11, 2020

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; 
@memming
Copy link
Member

memming commented May 11, 2020

I agree! Thanks for catching!

@lachioma
Copy link
Contributor Author

No problem!

Actually, regarding the unit of time, I think it is important to point out that the functions buildGLM.addCovariateTiming, buildGLM.addCovariateBoxcar and buildGLM.addCovariateRaw (which in turn call the function buildGLM.addCovariate)
want the input offset in ms even if you have unitOfTime = 's'.

Furthermore, I add issues using basisFactory.makeNonlinearRaisedCos with unitOfTime = 's'
so I changed its line 32 in

%iht = (0:binSize:mxt)';
iht = (0:binSize:mxt)'/binSize; 

and I provide the inputs endPoints and nlOffset in ms.

@memming
Copy link
Member

memming commented May 11, 2020

@lachioma I'm very grateful for your feedback. If you can send a pull-request, I'll merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants