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

expt.binfun creates some trouble #9

Open
ehennestad opened this issue Nov 22, 2017 · 1 comment
Open

expt.binfun creates some trouble #9

ehennestad opened this issue Nov 22, 2017 · 1 comment

Comments

@ehennestad
Copy link

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

@memming
Copy link
Member

memming commented Nov 26, 2017

It depends on how you define bin edges. The default binfun currently uses ceil to make sure the first bin starts at 0 and ends at the end of the binwidth. You can use a custom binfun if you'd like. All code should be calling exp.binfun, so you can replace the function handle.

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