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

Factor and Half-window parameters #103

Open
Mattlab-hub opened this issue Dec 12, 2022 · 2 comments
Open

Factor and Half-window parameters #103

Mattlab-hub opened this issue Dec 12, 2022 · 2 comments
Labels
❔ question Further information is requested

Comments

@Mattlab-hub
Copy link

Hi, could you put a little more detail on the website on exactly what the Factor and Half-window size are changing. It is clear what they are for, but what is not clear is what the numerical input is. Are the numbers representing the number of time points based on the sampling rate or are they a weight that is being applied and how much does a single unit increase affect the smoothing?

Thank you,
Matt

@vferat vferat added the ❔ question Further information is requested label Dec 12, 2022
@vferat
Copy link
Owner

vferat commented Dec 12, 2022

Hey @Winter-Bot,

  • half window size: A window of 2 * half window size + 1 around each sample will be used to smooth the segmentation. The window size is expressed in sample. For example, for a sampling rate of 512Hz, a half window size of 10 will correspond to smoothing window of 2*10+1 = 21 sample -> 0.41s.

  • factor is the non smoothness penalty parameter (i.e. how strong the smoothing is). This seems to have no influence as long as it is larger than 1.

To put it in a nutshell, half window size is how far in time ( past and futur) you use information to smooth, Factor is how strong you smooth.

I recommend to check Table II of this article for more details: Segmentation of Brain Electrical Activity into Microstates: Model Estimation and Validation. You can also have a look at the smoothing section of this notebook.

Hope it helps,
Victor

@Mattlab-hub
Copy link
Author

Mattlab-hub commented Dec 16, 2022

Hi @vferat ,

Thanks for the descriptions! I just want to check a few things to make sure I am calculating everything correctly.

  • First, do you mean 0.041s instead of 0.41s? That's what I get with (2*10+1)/512hz, or am I misunderstanding?

  • Second, that notebook link was super helpful, so thank you again. I just wanted to double check that below the segmentation figures, such as "In [22]:" where you give different examples of half_window_sizes; below is the smoothing window size for each half_window_size, which is states in milliseconds. Is this supposed to be in seconds? I assume this is the same thing you gave for the example above of a half_window_size=10 and a sampling_frequency=512hz.

  • Third, from the Pascual-Marqui paper's table 2, I am guessing that in ModK.predict() the factor argument is their lambda and half_window_size is their b, correct? Or is it more complicated than that? If that is the case, is the argument min_segment_length anything from table 2 of that paper?

Thanks again,
Matt

@vferat vferat added this to Evaluation in Pycrostates Kanban Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔ question Further information is requested
Projects
Development

No branches or pull requests

2 participants