 an expectation-maximization (EM) algorithm, which allowed us to estimate the contribution of each of the three latent factors to the variability of each element of the sequence. We applied the model to the songs of 11 adult male zebra finches and found that for most birds the model provides very good fits to trial-to-trial variability in the durations of individual song vocalizations (syllables) and the gaps of silence between them. For individual syllables and gaps, a roughly equal amount of variability is contributed by each of the three components of timing variability. For 5 birds, the model appears to be optimal when including an additional latent variable in which syllable and gap durations are anti-correlated. We also performed Monte Carlo simulations to investigate how accurately the model was able to fit artificial data sets where the underlying timing parameters and latent variables were known.

Results
This paper develops a statistical model to estimate latent factors governing trial-to-trial timing variation in repeated action sequences. We will present our results in three sections. First, we describe our model which we call the ''timing variability model.''We then fit the model to timing data from zebra finch songs, and present several results regarding the nature of timing variability in this species. Finally, we describe Monte Carlo simulations designed to quantify the reliability of the model fits.

Timing Variability Model
The timing variability model can be applied to data consisting of repeated action sequences that can be divided into consecutive time intervals, as might be observed during the production of a stereotyped behavior over multiple trials. Although the model may be applied to any action sequence, here we apply the model to quantify timing variability in the songs of male zebra finches. Each adult produces a song that is highly invariant but unique to that male (Fig. 1A). The song of each male consists of a stereotyped string of 3-7 distinct vocalizations we term ''syllables'' that vary in duration from approximately 50 to 200 msec; syllables are separated by gaps of silence that are roughly half the duration of syllables. We will use the term ''motif'' to denote a male's stereotyped string of syllables, while a song ''bout'' consists of a series of motifs produced back-to-back. We restricted the analysis to the first motif of each bout; however, to examine the gap of silence between the 1st and 2nd motifs, we included the first syllable of the second motif in the sequences analyzed. We will use the term ''time interval'' to denote the durations of both syllables and silent gaps, so if a sequence consists of L syllables, it also contains L{1 gaps and thus 2L{1 time intervals. The duration of each syllable and silent gap is also fairly stereotyped, varying across motif renditions by about 1.5-3.5 msec standard deviation in duration, or,2-5% coefficient of variation (CV) [15]. This temporal stereotypy gives each male's song a very characteristic rhythm [15,20].
Variance decomposition. To start we describe the model from the perspective of variance decomposition, generally following the standard approach known as factor analysis [17,19,21,22]. As outlined in the introduction, we would like to write the variance in interval length as a sum of three component variances: variance in tempo spread across the song, independent variance that is specific to each timing interval within the song, and timing jitter in the exact placement of the onset and offset of each song syllable.
For the first factor, we presuppose a non-observable, latent factor z that influences song tempo, with z n representing the deviation in tempo from its mean value on each trial n. If the change in tempo is spread uniformly over the song, the deviation in the length of interval k will be proportional to the mean length of that interval, x x k ; that is, the deviation will equal z n x x k. However, the timing variability model is not restricted to uniform changes in tempo. Rather, deviations in global timing are modeled as W k z n where the values W k are free parameters representing the relative sensitivity of each interval to variations in global timing. For that reason, we refer to W k as the ''global weight'' for interval k. Under these assumptions, variations in global timing will contribute a variance component to interval k equal to W 2 k Var(z) where Var(z) represents the variance of the latent factor z. Importantly, global timing will also result in a covariance between interval j and interval k equal to W k W j Var(z). By fitting this pattern of covariances to the off-diagonal elements of the data covariance matrix, the model forms an estimate of the global sensitivity of each interval to global timing (Fig. 1C, left).
A similar approach can be used to estimate the variance contributed by timing jitter. For this component, we presume that the length of each interval is set centrally, but the measured timing of the transition between consecutive intervals is subject to variation downstream of central pattern generator for song, either in the motor periphery or during the measurement process. We let u kn denote the jitter in timing between interval k and kz1 on trial n. As noted by Wing and Kristofferson [16] in the context of human finger-tapping experiments, such timing jitter introduces a negative covariance between adjacent intervals in addition to contributing to the variance in interval duration (Fig. 1C, right). As before, off-diagonal values in the data covariance matrix can be used to estimate the magnitude of timing variance at each boundary in the sequence. We denote the variance at the kth boundary by V kk. The variance contributed by jitter the timing of interval k will be V kk +V k{1,k{1.
Finally, we assume that each interval k is subject to its own degree of independent variation g kn on trial n. This independent variance can be estimated by calculating the total interval variance and subtracting the variance contributed by global and jitter factors. We denote the independent variance for interval k by Y kk.
Variance decomposition in the model is shown in figure 1. Panel B shows the data covariance matrix from a single bird. Panel C shows the three matrices of covariance contributed by the global, independent and jitter terms in the model to the right and how these sum to equal the model covariance matrix at the left.
The difference between the timing variability model and traditional factor analysis stems from the explicit incorporation of the negative covariances between adjacent intervals caused by timing jitter at syllable onsets and offsets. It should be noted that since the model can only estimate jitter by recognizing negative covariation between adjacent intervals, estimates of timing variability in the first and last intervals of the sequence will be inherently less accurate. As a result, we discarded the first and last intervals in the sequence from all reported analyses.
Generative model and maximum likelihood estimation. We used a maximum likelihood approach to fitting our model to the data [17,22,23]. More specifically, we view the timing variability model as a probabilistic model capable of generating artificial data consisting of N repeated sequences, each containing the duration of K consecutive time intervals. To generate such data, we assume that the parameters of the model are fixed and for each artificial sequence n we generate random values for the unobserved, latent variables: a single global timing variable, z n, independent variations for each of K intervals, g kn, and jitter variations at each of the K{1 boundaries between intervals, u kn. These are combined to produce K observed interval durations For convenience we can rewrite this equation in vector notation as: where D is the K|(K{1) differencing matrix with ones along the diagonal (D k,k~1 since boundary k causes deviations in the offset of interval k), negative ones along the subdiagonal (D k,k{1~{ 1 since boundary k{1 causes deviations in the onset of interval k), and 0 elsewhere. To allow theoretical derivations of maximum likelihood fits, we assume that the latent factors are independent and Gaussian distributed. The free parameters of the model are then the global weights in W (collectively referred to as the global parameters) and the variances of g k and u k. We let Y and V be the covariance matrices of the random vectors g and u respectively; these matrices are diagonal since the latent variables in g and u are assumed to be independent. The variance of the global parameter z is fixed at a value of one, with the magnitude of the global weights W determining the magnitude of the observed variances. Letting S be the covariance matrix of interval durations, and using the basic result that S~1 N X n x n x T n, equation 2 implies that in the limit of large N, the timing variability model will generate K dimensional Gaussian distributed data with covariance matrix In particular, for any given sequence of interval durations, we can calculate the probability that the timing variability model would generate that particular sequence. To fit the model to observed data, we find parameters W, Y and V that maximize the likelihood that the model would generate the observed collection of sequence durations. To accomplish this, we use an Expectation-Maximization (EM) algorithm that was modified from the standard EM algorithm used to generate maximum likelihood fits for standard factor analysis [17,23]. (See Methods for details.) A consequence of this maximum likelihood, generative approach is that the EM algorithm naturally yields estimates of the latent variables z n, u n and g n on a trial-to-trial basis. As we will demonstrate below, this allows for an analysis of the relationship between timing factors and other variables, such as time of day and behavioral state, that vary across samples but are not explicitly included in the model. Furthermore, the model can be used to generate artificial data sets from a model with known parameters. These artificial data sets can then be fit using the same class of model. This exercise allows one to estimate the