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

NaN values #15

Closed
luiscruz opened this issue Jan 5, 2016 · 4 comments
Closed

NaN values #15

luiscruz opened this issue Jan 5, 2016 · 4 comments

Comments

@luiscruz
Copy link

luiscruz commented Jan 5, 2016

Maybe this is a question out of pyeeg's scope...
Approximate entropy is a new concept to me and I'm having several NaN values in my data.

audio_ap_entropy_7days  activity_ap_entropy_7days
1   NaN NaN
2   -0.085044   -0.085044
4   -0.096893   -0.096893
5   -0.088628   -0.088628
7   -0.110994   -0.110994
8   NaN NaN
9   -0.086203   -0.086203
10  -0.085044   -0.085044
12  -0.085044   -0.085044
14  NaN NaN
15  NaN NaN
16  -0.088628   -0.088628
17  NaN NaN
18  NaN NaN
19  NaN NaN
22  NaN NaN
24  -0.169545   -0.169545
25  NaN NaN
27  -0.085044   -0.085044
30  NaN NaN
32  NaN NaN
33  NaN NaN
41  NaN NaN
43  NaN NaN
46  NaN NaN
49  -0.085044   -0.085044
52  NaN NaN
54  NaN NaN
57  -0.085044   -0.085044
59  -0.085044   -0.085044

Is this a normal behavior in approximate entropy, or do you think there's something wrong?

Luis

@Borzou
Copy link
Contributor

Borzou commented Jan 5, 2016

Hi Luis,

I am not sure if I understand this data, could you help me better understand
it? Are these the results after running app_entropy on your data? What are
the rows and the columns?

Thanks,
Borzou

On Tuesday, January 5, 2016, Luis Cruz notifications@github.com wrote:

Maybe this is a question out of pyeeg's scope...
Approximate entropy is a new concept to me and I'm having several NaN
values in my data.

audio_ap_entropy_7days activity_ap_entropy_7days
1 NaN NaN
2 -0.085044 -0.085044
4 -0.096893 -0.096893
5 -0.088628 -0.088628
7 -0.110994 -0.110994
8 NaN NaN
9 -0.086203 -0.086203
10 -0.085044 -0.085044
12 -0.085044 -0.085044
14 NaN NaN
15 NaN NaN
16 -0.088628 -0.088628
17 NaN NaN
18 NaN NaN
19 NaN NaN
22 NaN NaN
24 -0.169545 -0.169545
25 NaN NaN
27 -0.085044 -0.085044
30 NaN NaN
32 NaN NaN
33 NaN NaN
41 NaN NaN
43 NaN NaN
46 NaN NaN
49 -0.085044 -0.085044
52 NaN NaN
54 NaN NaN
57 -0.085044 -0.085044
59 -0.085044 -0.085044

Is this a normal behavior in approximate entropy, or do you think there's
something wrong?

Luis


Reply to this email directly or view it on GitHub
#15.

@luiscruz
Copy link
Author

luiscruz commented Jan 5, 2016

This table has the results of ap_entropy for each participant (row).
The columns is repeated by mistake.

I think I've found the issue. I am calculating ap_entropy for the mean activity of a person in a day. I have data for approximately 90 days.
I've just found that in that data I also have a few NaN in some participants. So I'm getting a ap_entropy of NaN in those participants.

Do you know what's the best way to deal with NaN days?

@Borzou
Copy link
Contributor

Borzou commented Jan 5, 2016

Let me see if I understood your problem correctly. You have a data
collected over 90 days on about 59 participants. For each participant, you
are analyzing the data by taking the mean activity over a day, and
calculating the approximate entropy of the resulting series.

If you have NaN for a patient of yours, it is possible that you may end up
getting NaN for your ap result. If the NaN values start after a certain
time point, one way to overcome your problem is to analyze the data only up
to that point in time. The other way is to take the average of two days
rather than one day, this will creat a bias towards having low entropy
however. You can also replace the NaN values with random numbers having
distance higher than your chosen threshold from your data points and from
each other. If you simply ignore the NaN values, omit them from your
dataset, and they are randomly distributed then you will get a bias towards
having high entropy.

On Tuesday, January 5, 2016, Luis Cruz notifications@github.com wrote:

This table has the results of ap_entropy for each participant (row).
The columns is repeated by mistake.

I think I've found the issue. I am calculating ap_entropy for the mean
activity of a person in a day. I have data for approximately 90 days.
I've just found that in that data I also have a few NaN in some
participants. So I'm getting a ap_entropy of NaN in those participants.

Do you know what's the best way to deal with NaN days?


Reply to this email directly or view it on GitHub
#15 (comment).

@luiscruz
Copy link
Author

luiscruz commented Jan 5, 2016

This is great @Borzou ! I will try it and let you know.
Thank you so much.

@luiscruz luiscruz closed this as completed Jan 5, 2016
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