Spike Toolbox

STInstantiate
Convert spike train definitions into concrete trains

Syntax
[stTrain] = STInstantiate(stTrainDef, <'regular' / 'poisson'>, tDuration <, mCorrelation, fMemTau>)

Description
stTrainDef is a spike train containing a simple train definition created by STCreate. tDuration is the desired duration of the spike train in seconds. The type of spike train is specified using either regular or poisson. A regular train has equal inter-spike intervals based on the train freqeuncy. A poisson train generates spikes according to a probability based on the train frequency. stTrain (output) will have a instance field added, containing the instantiated train.

Note: Changing frequencies and regular spike trains don't play well together. Perhaps a better algorithm for creating regular trains is required.

Array arguments
STInstantiate can accept arrays for any and all input arguments. In the case of stTrainDef and the temporal type, these must be cellular arrays. In the case of tDuration, mCorrelation and fMemTau, these should be standard matrices. If one or more arguments are passed as arrays, multiple spike trains will be instantiated, each train with options taken from one element of each array. If only some arguments are passed as arrays, the scalar arguments will be applied to all trains. When arrays of arguments are supplied, stTrain will be a cellular array of instantiated spike trains.

Note: Although the calling syntax allows for an array of tDurations specifying a separate duration for each train, in practice this is not supported. Please use a common duration for all trains.

Example: cellST = STInstantiate({stDef1 stDef2}, 'poisson', 5);

stDef1 and stDef2 are two different spike train definitions. cellST will be a cell array with two elements, each containing a separate instantiated spike train. These trains will have frequency profiles corresponding to stDef1 and stDef2, but will both be poissonian and of 5 seconds duration.

Correlated spike trains
The optional argument mCorrelation can be used to generate correlated spike trains. mCorrelation should be a correlation matrix specifying the pairwise correlations between each of a set of spike trains. The matrix should be in upper-diagonal form, with unit diagonal elements. In this matrix, 1 specifies the maximum possible correlation and -1 specifies the maximum possible anti-correlation. Note that mCorrelation must be positive definite. This means that if the matrix is made symmetric, it will have only positive eigenvalues.

Example:
mCorr = [1.0 0.9 0.8;
         0.0 1.0 0.7;
         0.0 0.0 1.0];

Executing STInstantiate with this correlation matrix will produce three spike trains; the correlation coefficient between trains i and j (with ij) is given by mCorr(i, j).

Non-ergodic spike trains
The optional argument fMemTau can be used to generate spike trains from a non-ergodic process (ie a random process with memory). fMemTau will be the time constant for an exponential smoothing function. fMemTau will be the time for the memory effect to reduce to approximately 35%.

When both mCorrelation and fMemTau are supplied, correlated random sequences will be generated before being made non-ergodic.

To impose non-erogidicy without correlations, provide an empty matrix for mCorrelation.

See Also
Generating advanced spike trains, STCreate


$Id: STInstantiate.html 1783 2005-08-31 21:05:51Z dylan $