I've obtained 2840 observations of a stochastic process with large Gaussian noise. The process parameters change at one point around the 1500th observation. I've ensemble-averaged these into sets of 10, 40 and 284 observations and would like to present those three sets to the readers of my report, but I can't figure out a good way of visualising this data.

Ideally, the visualisation would let the viewer see:

  • the wave morphology
  • the impact of noise, i.e. how much one averaging differs from another in the set
  • the point where the wave morphology changes

I could plot them all in a single graph. This gives a good idea about the impact of noise, but loses the chronological order of the waves. Also, it would only work for the set of 10 before becoming unmanageable.

enter image description here

I could also plot them as a 3D surface with the X axis showing time in a sample and the Z axis the ordinal number of the observation. One problem is that some waves are seen better than others, making it hard to compare the noise levels and wave morphologies quantitatively from the graph.

enter image description here

How could I best visualise these averaged sets of observations?

  • $\begingroup$ Can you give some more details on what kind of data this comes from? $\endgroup$
    – cardinal
    Commented Dec 17, 2011 at 20:33
  • $\begingroup$ Some observations: (1) It appears that something close to a high-pass filter has also been applied to this data. I would have said that was for sure the case, except that the means of each time-series are not quite close enough to zero. (Could be a bad filter or one with very large transient.) (2) These appear to be something like 5 pairs of time-series as opposed to 10 time-series of the same process. (cont.) $\endgroup$
    – cardinal
    Commented Dec 17, 2011 at 20:38
  • $\begingroup$ (3) If, indeed, these are high-pass filtered, then I would guess that whatever is happening around index 125 is actually something like a sudden step down, followed by a step back up of the same size. A high-pass filter would distort such a feature in exactly the way shown in the plot. (4) Instead of aggregating the data by averaging in blocks, you can use a low-pass filter, like a moving average (there are likely better options, though application-specific). (5) I would not call what you've done ensemble averaging. That would be averaging each of the points across the 10 series. $\endgroup$
    – cardinal
    Commented Dec 17, 2011 at 20:40
  • $\begingroup$ @cardinal: Thank you for your comments! They are recordings of a patient's EEG response to specific stimuli, repeated 2840 times with 80ms/256sa per recording. Here are some colour maps with proper axes: 284 and 40 observations per ensemble. (1) The signal that was ensemble-averaged contains significant low-frequency components. (2) The reason for this is a change in parameter around series index 5, if that's what you mean? (3) The spike is at the exact point of the stimulus, and is expected. $\endgroup$
    – user8057
    Commented Dec 17, 2011 at 21:08
  • $\begingroup$ @cardinal: (4) That is a good point, and something I'm planning to do. It gives a neater time resolution, too. (5) What do you mean by across? The 10 series shown above are the result of averaging 2840 series. $\endgroup$
    – user8057
    Commented Dec 17, 2011 at 21:09

1 Answer 1


If you're sure that it changes at one point, you can do two plots: one for the prebreak realizations and one for the postbreak realizations. If you're not sure that it only changes at a point, you can break things up into smaller subsets and look at them all separately. Here's some illustrative R code that uses the lattice package and conditions on blocks of the time period:

rprocess <- function(n, slope) {
  x <- slope * (1:n) + rnorm(n)
  cbind(i = 1:n,
        x = (4/n) * (1:n) * sin(10 * (1:n) / n) + x)

nFns <- 200
obsPerFn <- 200
d <- data.frame(do.call(rbind, 
  c(lapply(1:nFns, function(t) 
           cbind(t = t, rprocess(obsPerFn, 0))),
    lapply(nFns + (1:nFns), function(t) 
           cbind(t = t, rprocess(obsPerFn, -.2))))))

xyplot(x ~ i | (t - 1) %/% 45, groups = t, type = "l",
       data = d, col = rgb(0,0,0,.3), layout = c(9, 1))

Obviously it could be improved a lot.

If you can plot the data before averaging, you probably want to do that as well -- you'd like to use the graphics to complement your model/analysis and to convince the readers that it's appropriate, and that's much less compelling if only processed data are presented.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.