|
|
(106 intermediate revisions by one other user not shown) |
Line 1: |
Line 1: |
| {{PAGE UNDER CONSTRUCTION}}
| |
|
| |
|
| ==Regularized Higher-Order Partial Least Squares Analysis for ECoG Data==
| |
| By Frederick Campbell and Kelly Geyer, June 2017
| |
|
| |
| ==Introduction==
| |
| This page contains documentation of our MATLAB package for the tensor factorization algorithm Regularized Higher-Order Partial Least Squares (RHOPLS). This algorithm is specifically designed for electrocorticography (ECoG) data, with dimensions consisting of electrodes, epoch time, and frequency.
| |
|
| |
| Current capabilities:
| |
| # Data pre-processing: multiple methods for scaling data and removing outlier trails
| |
|
| |
| Upcoming capabilities:
| |
| # RHOPLS algorithm implementation
| |
| # Visualization of final factorization results, along with capabilities to view data during processing. Potential functionality for SUMA visualization
| |
|
| |
| ==Requirements==
| |
| Required Software:
| |
| # R
| |
| # MATLAB Tensor Toolbox Version 2.6
| |
|
| |
| Before using this package, a user should configure the file rhopls_setup.m so that it can install Tensor Toolbox and set up environment variables for the current Matlab session. This function should be called before using any of the package functions. It only requires editing the first two variables:
| |
| <code>
| |
| tensor_toolbox_dir = './tensor_toolbox';
| |
|
| |
| usr_local_bin = '/usr/local/bin';
| |
| </code>
| |
|
| |
|
| |
| Install packages with the commands. These commands are very useful to include at the beginning of any script that uses the rhopls package.
| |
| <code>
| |
| % Install RHOPLS package
| |
| cd(rhopls_dir);
| |
| addpath(pwd);
| |
| savepath;
| |
| % Install required toolboxes
| |
| rhopls_setup();
| |
| </code>
| |
|
| |
| ==Processing ECoG Data for Analysis==
| |
|
| |
| The RHOPLS package provides several methods of data standardization and outlier trial removal. The function <code>load_patient_data<\code> implements these in a user-friendly wrapper. Ultimately it creates the design matrix for a single patient, which is actually a 4-dimensional tensor with dimensions (trials x electrode x freq x time). This function not only returns the design tensor, trail labels and metadata, but saves them to the original data folder.
| |
|
| |
| Data standardization methods:
| |
| # 'flatten_trials': This function flattens the ECoG tensor by trial, or first dimension, and then centers and scales data according by user options
| |
| # 'array_normal': This function centers and scales data using the array normal method, according by user options. The array normal distribution is a higher-order generalization of the multivariate normal distribution. We estimate a mean and covariance assuming the tensor was generated via the array normal distribution and use the estimated parameters to center and scale the tensor.
| |
|
| |
| Things to note:
| |
| # This function assumes that the files '<patient ID>_trial_labels.mat', '<patient ID>_TFR_ao.mat', and '<patient ID>_TFR_ao_LowFreq.mat' exist in a directory named <patient ID>
| |
|
| |
|
| |
|
| |
|
| |
| <code>
| |
| %% Load and process ECoG data
| |
| % Import design matrix for patient k
| |
| % Create the data matrix that we use for patient k
| |
| % Description of data loaded: This is a 3-dimensional tensor
| |
| % Dimensions: (trials X label) - Fred's data
| |
| std_method = 'flatten_trials';
| |
| center = true;
| |
| scaled = true;
| |
| rm_outliers = true;
| |
| overwrite = true;
| |
| verbose = true;
| |
| [X, trial_labels, metadata] = load_patient_data(patient_dir, ...
| |
| 'standardizationMethod', std_method, ...
| |
| 'center', center, ...
| |
| 'scaled', scaled, ...
| |
| 'removeOutliers', rm_outliers, ...
| |
| 'overwrite', overwrite, ...
| |
| 'verbose', verbose);
| |
| </code>
| |
|
| |
| ==ECoG RHOPLS==
| |
| parameter tuning, fit model
| |
|
| |
| ==Results==
| |
| do analysis here, show plots
| |
|
| |
| ==References==
| |
| # Frederick Campbell, "Interpretable Brain Decoding for Electrocorticography Data though Regularized High Order Partial Least Squares." In progress.
| |
| # Brett W. Bader, Tamara G. Kolda and others. MATLAB Tensor Toolbox Version 2.6, Available online, February 2015. URL: http://www.sandia.gov/~tgkolda/TensorToolbox/.
| |