MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fastest method for comparing overlapping times in random time series


Prince-Wright, Robert G SEPCO wrote:
> I have two lists, list1{ {t1,t1+dt1}, {t2,t2+dt2},..{ti,ti+dti}}, and
> list2, each representing 'time(i)' and corresponding 'time(i) +
> deltatime(i)'. The time(i) values are determined by an exponential
> inter-arrival time model, and the durations are a scaled uniform random
> variable. Both lists are ordered on time(i). You can think of list 1 as
> representing periods when System 1 is not working, and list 2 as the
> periods when System 2 is not working. Example lists are given as Cell
> Expressions below together with code to convert to a ticker-tape Plot
> (you may need to stretch the graphic to see clearly). The challenge is
> to develop a fast method for determining the periods when both Systems
> are not working, i.e. to create a list corresponding to the start and
> finish times of the overlaps.
>
>  Thus far I have only managed to use a Do loop which is very slow for long lists!
>
>  Bob
>
>  [...data snipped...]

I don't have access at the moment to a system with Mathematica,
so I haven't tried this, but something like

   IntervalIntersection[IntervalUnion[Interval/@list1],
                        IntervalUnion[Interval/@list2]]

seems like it ought to give what you want.


  • Prev by Date: Re: Problem with Import and/or J/Link
  • Next by Date: Third Announcement of the International Mathematica Symposium 2006
  • Previous by thread: Re: Fastest method for comparing overlapping times in random time series
  • Next by thread: Re: Fastest method for comparing overlapping times in random time series