Principal Component Analysis

This analysis calculates eigenvalues and eigenvectors (principal components) of the matrix of covariances of rate histograms. The analysis creates population vectors corresponding to the principal components.

Parameters

Parameter

Description

Bin

Bin size in seconds.

Vectors Prefix

A string specifying how the population vector names will be generated. For example, if prefix is pca1, the vector names will be pca1_01, pca1_02, etc.

Select Data

If Select Data is From Time Range, only the data from the specified (by Select Data From and Select Data To parameters) time range will be used in analysis. See also Data Selection Options.

Select Data From

Start of the time range in seconds.

Select Data To

End of the time range in seconds.

Interval filter

Specifies the interval filter that will be used to preselect data before analysis. See also Data Selection Options.

Send to Matlab

An option to send the matrix of numerical results to Matlab. See also Matlab Options.

Matrix Name

Specifies the name of the results matrix in Matlab workspace.

Matlab command

Specifies a Matlab command that is executed after the numerical results are sent to Matlab.

Send to Excel

An option to send numerical results or summary of numerical results to Excel. See also Excel Options.

Sheet Name

The name of the worksheet in Excel where to copy the numerical results.

TopLeft

Specifies the Excel cell where the results are copied. Should be in the form CR where C is Excel column name, R is the row number. For example, A1 is the top-left cell in the worksheet.

Summary of Numerical Results

The following information is available in the Summary of Numerical Results

Column

Description

Variable

Variable name and PCA statistics name.

pca1_N

The weight of the variable in the N-th eigenvector. The rows at the bottom of the table also show Eigenvalue of this eigenvector, % of variance it explains, and the cumulative percent of the variance explained by this and preceding eigenvectors.

Corr with VAR

Correlation with the specified variable.

Numerical Results

The Results sheet shows for each neuron the weights this neuron has in all the eigenvectors.

Algorithm

Step 1

Rate histograms are calculated for each of the selected neurons.

The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin, Xmin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin.

For each bin, the number of events (spikes) in this bin is calculated.

For example, for the first bin

bin_count = number of timestamps (ts) such that ts >= XMin and ts < XMin + Bin

Bin counts are calculated in such a way for all the selected variables to produce in a matrix

bin_count[i, j], where i is the neuron number, j is the bin number.

Step 2

The matrix of covariances between neurons c[t, s] is calculated:

c[t, s] = correlation between vectors bin_count[t, *] and bin_count[s, *], s, t = 1, ...,number_of_selected_neurons.

Step 3

The eigenvalues and eigenvectors are calculated for the matrix c[t, s]. The eigenvectors (principal components) are sorted according to their eigenvalues. The first principal component has the largest eigenvalue.

Each principal component becomes a new population vector in the data file.