JoseAlanis's Blog

Blogpost: 8th week of GSoC (Jul 15 - Jul 21)

JoseAlanis
Published: 07/22/2019

With this week, the second month of GSoC also comes to an end. It feels like a good moment for providing a summary of the progress made so far and also an outlook, considering the tasks and challenges that remain ahead.

Building MNE-LIMO, a "workbench" for linear regresssion analyis in MNE-Python

At the beginning of this GSoC project we set the primary goal of extending the functionality of the linear regression module in MNE-Python. During the last two months, I've focussed my work on developing functions, example code, and methodological tutorials with the purpose of providing MNE-users with a learning-oriented environment, or "workbench", for specifying and fitting linear regression models for experimental designs that are commonly used by the neuroscience community.

Here, we have achieve a some important milestones, such as showing how the python package scikit-learn can be used to fit linear-regression models on neural time-series data and how MNE-Python can be used in interface with the output of these tools to compute and visualize measures of inference and quality of the model's results.

In addition, we have recently launched a website, MNE-LIMO (short for MNE-LInear Regression MOdel), where we provide more background information and details on these tools and methods.

Bringing MNE-LIMO to the next level.

The challenge for the next month is to extend the tools and methods we've developed so far to allow the estimation of linear regression effects over multiple subjects. The goal here is to use a mass-univariate analysis approach, where the analysis methods not only focus on a average data for a few recording sites, but rather take the full data space into account.

This approach also represents the greatest challenge of the project as it rises a series of implications for further analyses and assesment of the results, such as controlling for an increased number of potential false positive results due to multiple testing.

In the following weeks I'll focus on adapting the tutorials and examples developed during the last few weeks to allow this kind of analyses.

 

 

 

View Blog Post

Check-in: 7th week of GSoC (Jul 08 - Jul 14)

JoseAlanis
Published: 07/15/2019

1. What did you do this week?

This week I continued to work on the documentation website for my GSoC project.

This included:

  • Adding configuration files and changing the structure of the repo (see here) to be more learning-oriented and shows some of the basic functionality of MNE-LIMO (short for "using LInear regression MOdels in MNE-Python").
  • Currently, we are implementing a series of examples to fit linear models on single subject data.
  • In addition, we have started to develop method to translate single subject analysis to group-levels analysis, i.e., estimating linear regression effects over a series of subjects.
  • These sections in the documentation, single subject vs. group-level analyses, cover useful analysis techniques that can be used to estimate linear regression effects and derive inferential measures to evaluate the estimated effects.

2. What is coming up next?

  • Next week, I'll focus on extending the group-level section of the repo.

3. Did you get stuck anywhere?

  • Aside from minor issues and initial difficulties while writing the configuration files needed to build the sphinx-documentation. It all went pretty smooth.
View Blog Post

Blog post: 6th week of GSoC (Jul 01 - Jul 07)

JoseAlanis
Published: 07/08/2019

This week I was able to make good progress and finalize on a couple of PRs on my GSoC project repository on GitHub.

In particular, this weeks work was focused on visualization of the results of the linear regression analysis for neural time series data that I've been working on during the last few weeks, with special concentration  on inferential measures, such as p-values, t-values, and indices of goodness of fit for the model, such as R-squared.

In addition I started to build up the documentation for my GSoC project. The idea is to use the documentation site as a gallery of examples and practical guides or "walkthroughs" that focus on typical analysis scenarios and research questions. This way MNE-users can easily adapt the code to their needs and make use of the linear regression framework more flexibly.

Next week, I will continue to build up the site and documentation for my GSoC project repository on GitHub and extend the examples to perform second-level analyses.

View Blog Post

Check-in: 5th week of GSoC (June 24 - June 30)

JoseAlanis
Published: 07/01/2019

Most of this week's work was related to continue the development of scripts and example code files that look at possible ways of computing interesting parameters and visualizing the results of linear regression algorithms for neural times series data.

1. What did you do this week?

Thus, this week's progress is easily summarized with the following bullets and links:

  • Write an example script that shows how to compute and visualize the coefficient of determination, i.e., the proportion of explained variance by a set of predictors in a linear model. The nice thing about this is that we can visualize this effects in an "EEG" fashion, i.e., in a way that MNE-users will probably will find appealing (see here).
  • Other work was related on computing inferential measures for the same effects, such as p- and t-values, that might help interpret the significance of effects on a more straight forward manner.

2. What is coming up next?

I believe that we have established a good basis of analyses during the last few weeks and hope to be able to tackle second level analysis next week (i.e., the estimation of linear regression effects on set of data from different individuals).

3. Did you get stuck anywhere?

I don't feel like I got stuck with anything in particular. Although, the more I get into this GSoC-project, the more I find my self needing recap some basic linear and matrix algebra lessons. Although I remember some of these things from my schoolwork, it is from time to time challenging. Nevertheless, I feel like I'm "relearning" a lot and deepening my understanding of the mathematical basis of the tools we're trying to implement during this GSoC.

 

View Blog Post

Blog post: 4th week of GSoC (June 17 - June 23)

JoseAlanis
Published: 06/24/2019

This week I focused on setting up a couple of example scripts to demonstrate the functionality of the bootstrap procedure for the analysis of time-series neural data using MNE-Python.
 
Bootstrap refers to a widespread and acknowledged method for statistical inference. In essence, bootstrapping relies on the idea that using the data at hand can help draw better (i.e., more robust) conclusions about the effects we are trying to estimate.

Compared to more traditional methods, which often rely on (sometimes unjustified) assumptions about the distributional characteristics of the data, bootstrapping provides a method for accounting for biases specific to the nature of the observed data (e.g., skewness, clustering).

The main idea in bootstrapping relies on the drawing of random samples with replacement from the data set. Ideally, when we carry out an experiment, we would like to replicate its results in a series of further experiments and this way derive a certain measure of confidence for the effects observed. With bootstrap we can use the data at hand to simulate what the results of these experiments might be if the experiment was repeated over and over again with random samples.

During this week, my work focused on implementing a bootstrap procedure to derive confidence intervals for an average scalp-recorded brain signal over a certain period of time. In other words, the goal was to plot the average time series of brain activity along with the range of possible average values one could expect if the experiment was repeated a certain number of times (e.g. 2000 times). An example of the results is shown below.

In the image above, time is depicted on the X-axis and the strength of activation on the Y-axis. The average time series is depicted by the solid line. The 95 % confidence interval is depicted by the shaded ribbon surrounding the line. In other words, 95 % of the averages computed from the bootstrap samples where within this area.

After some initial difficulties, which I believe we’re mainly rooted on my initial misinterpretation of the bootstrapping results, I was able to set to make some progress on two example scrips for deriving bootstrap confidence intervals for the average evoked brain response in a particular condition (see here) and for the coefficients of a linear model estimator (see here). I look forward to continuing this work next week.

View Blog Post