Gaussian-Process Factor Analysis (GPFA)

Gaussian-process factor analysis (GPFA) is a dimensionality reduction method [gpfa1] for neural trajectory visualization of parallel spike trains. GPFA applies factor analysis (FA) to time-binned spike count data to reduce the dimensionality and at the same time smoothes the resulting low-dimensional trajectories by fitting a Gaussian process (GP) model to them.

The input consists of a set of trials (Y), each containing a list of spike trains (N neurons). The output is the projection (X) of the data in a space of pre-chosen dimensionality x_dim < N.

Under the assumption of a linear relation (transform matrix C) between the latent variable X following a Gaussian process and the spike train data Y with a bias d and a noise term of zero mean and (co)variance R (i.e., Y = C X + d + Gauss(0,R)), the projection corresponds to the conditional probability E[X|Y]. The parameters (C, d, R) as well as the time scales and variances of the Gaussian process are estimated from the data using an expectation-maximization (EM) algorithm.

Internally, the analysis consists of the following steps:

0) bin the spike train data to get a sequence of N dimensional vectors of spike counts in respective time bins, and choose the reduced dimensionality x_dim

1) expectation-maximization for fitting of the parameters C, d, R and the time-scales and variances of the Gaussian process, using all the trials provided as input (c.f., gpfa_core.em())

2) projection of single trials in the low dimensional space (c.f., gpfa_core.exact_inference_with_ll())

3) orthonormalization of the matrix C and the corresponding subspace, for visualization purposes: (c.f., gpfa_core.orthonormalize())

GPFA([bin_size, x_dim, min_var_frac, ...]) Apply Gaussian process factor analysis (GPFA) to spike train data


Visualization of GPFA transforms is covered in Viziphant:


View tutorial

Run tutorial interactively:

Original code

The code was ported from the MATLAB code based on Byron Yu’s implementation. The original MATLAB code is available at Byron Yu’s website:


[gpfa1]Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. Advances in neural information processing systems, 21:1881–1888, 2008.