vferat/pycrostates

Factor and Half-window parameters

Opened this issue · 2 comments

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

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

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