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

Error in pdf function #3

Closed
miguelmsemprun opened this issue Sep 27, 2019 · 5 comments
Closed

Error in pdf function #3

miguelmsemprun opened this issue Sep 27, 2019 · 5 comments

Comments

@miguelmsemprun
Copy link

Hi!
I continue using your code and i have seen a part of the code that is problematic for me:
utils.py: window = norm.pdf(np.arange(0, winwidth + 1), winwidth // 2, winwidth // 8) (line 162)
the problem is that in my code the input of the function 'smooth(data, winwidth_in)' the parameter winwidth_in is 4 so the output of the pdf function is a list of nan.
A posible solution i have checked (but I'm not sure of it) is to change it to:
window = norm.pdf(np.arange(0, winwidth + 1), winwidth / 2, winwidth / 8)
because the operator // get the floor division but in the previous order you have:
winwidth = int(np.floor(winwidth_in // 2) * 2) # force even winsize for odd window
So winwidth will be always even so the division 'winwidth / 2' shoud always be equals to 'winwidth // 2' but I don't understand why in this case not.
If you have any idea why i have this problem it would be great, but thank you anyways for this wonderful program.
PS: I work with e4_empatica data which have 4 Hz

@MarcoFiletti
Copy link
Collaborator

MarcoFiletti commented Sep 30, 2019

Hello,

do you have some test data that I can use? That way I can compare the results you get with Ledalab.

@miguelmsemprun
Copy link
Author

https://drive.google.com/file/d/1ABRC3nIXdZo5i-MLzVmQJlr4WQ1THiSQ/view?usp=sharing
The data are from a empatica. First row is the timestamp and second is sampling frequency; the rest are the data.

@MarcoFiletti
Copy link
Collaborator

Hi,

I did a test and the results look ok to me. Are you using the latest version? I think the changes you suggested were already done (in commit af1969b, Aug 4, 2019)

@miguelmsemprun
Copy link
Author

You are right, it is working perfectly

@MarcoFiletti
Copy link
Collaborator

Alright, thank you

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