danielemarinazzo / KernelGrangerCausality

Code to evaluate nonlinear Granger causality using the kernel trick to reduce complexity
BSD 3-Clause "New" or "Revised" License
34 stars 14 forks source link

which script consists of kernel granger casuality function? #2

Closed manvirvirk closed 5 months ago

danielemarinazzo commented 11 months ago

causality.m is the main function, it calls other ones.

manvirvirk commented 11 months ago

Thanks for the information, i could use it now. I have one more query how to apply granger causality for non-stationary signals as it is meant that it can be applied only for stationary signals.

danielemarinazzo commented 11 months ago

If your time series do not satisfy the stationarity criterion of your choice, then you should use a sliding window (if you have enough samples per window and/or multiple trials), or use another time varying approach.

manvirvirk commented 11 months ago

@danielemarinazzo i have non stationary brain signal with several trials. I have filtered it and windowed it into 2s segment. After this i got matrix of 500 by 35 to which i applied granger to select columns . Is this the way you you are saying?

danielemarinazzo commented 11 months ago

and where are you using the trials? what is 500 and what is 35?

manvirvirk commented 11 months ago

@danielemarinazzo 500 are trials and 35 are number of channels of brain signals

danielemarinazzo commented 11 months ago

This indeed allows you to perform a time point by time point analysis, but not Granger causality since all data refers to the same time point. The minimal window should be equal to the order of your auto regressive model plus one.

On Thu, 23 Nov 2023, 15:23 manvirvirk, @.***> wrote:

@danielemarinazzo https://github.com/danielemarinazzo 500 are trials and 35 are number of channels of brain signals

— Reply to this email directly, view it on GitHub https://github.com/danielemarinazzo/KernelGrangerCausality/issues/2#issuecomment-1824520834, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIQU7T5DV4WK2QPBRVKLU3YF5L6BAVCNFSM6AAAAAA7Q2HM5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRUGUZDAOBTGQ . You are receiving this because you were mentioned.Message ID: @.***>

manvirvirk commented 11 months ago

@danielemarinazzo does this repo, causality.m find the granger causality or not?

danielemarinazzo commented 11 months ago

the repo or the function? The function causality.m computes Granger causality indeed.

On Thu, 23 Nov 2023 at 18:20, manvirvirk @.***> wrote:

@danielemarinazzo https://github.com/danielemarinazzo does this repo, causality.m find the granger causality or not?

— Reply to this email directly, view it on GitHub https://github.com/danielemarinazzo/KernelGrangerCausality/issues/2#issuecomment-1824751611, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIQU7X5IYMHJWLZIW347CTYF6AUTAVCNFSM6AAAAAA7Q2HM5SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRUG42TCNRRGE . You are receiving this because you were mentioned.Message ID: @.***>

manvirvirk commented 11 months ago

ok thank you for the help @danielemarinazzo (y)