File Exchange

image thumbnail

Testing GPFA method on simulated data

version (6.39 KB) by Valentina Unakafova
Example of testing GPFA method on simulated data

1 Download

Updated 03 Aug 2017

View License

Testing GPFA method
This code is programmed according to description in the last section in [BCS] (Simulation with error floor). The aim is to help understanding how to use GPFA package [1] and to test it on simulated data (an example for using HighDim package is also provided).

[BCS] Byron, M.Y., Cunningham, J.P., Santhanam, G., et. al, 2009. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. In Advances in neural information processing systems (pp. 1881-1888).
[1] GPFA and HighDim packages,

1 Make sure that you have downloaded GPFA and HighDim packages from
and added them to MATLAB path.
2 Run the sections step by step and check if the underlying dimension is detected correctly (if prediction error has its minimum at nDims value after performing full cross-validation section, nDims is set to 5 in GPFAsimulations.m for an example)
3 Change parameters of input data and run the example again to check whether the underlying dimension is detected correctly. One can change, for example
3.1 dimension of input data nDims (then change dimensions of A and B, correspondingly)
3.2 frequency A or amplitude B of sinusoids
3.3 number of units nUnits
3.4 covariance matrix R of noise
3.5 bin width binWidth
3.6 length of trial trialLength in ms

1 Generate simulated data
2 Plot simulated data
3 Prepare data in proper format for GPFA
4 Launch GPFA on simulated data
5 Launch full cross-validation
6 Preparing data for HighData toolbox
7 Example for using previously-fit model parameters for extracting neural trajectories

Please, see further examples and explanations of GPFA and HighDim method at and in [BCS]

Cite As

Valentina Unakafova (2020). Testing GPFA method on simulated data (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!