[R] Fitting inter-arrival time data

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jun 30 09:04:22 CEST 2003


On Sun, 29 Jun 2003, M. Edward Borasky wrote:

> I have a collection of data which includes inter-arrival times of requests
> to a server. What I've done so far with it is use "sm.density" to explore
> the distribution, which found two large peaks. However, the peaks are made
> up of Gaussians, and that's not really correct, because the inter-arrival
> time can never be less than zero. In fact, the leftmost peak is centered at
> somewhere around ten seconds, and quite a bit of it extends into negative
> territory.
> 
> What I'd like to do is fit this dataset to a mixture (sum) of exponentials,
> hyper-exponentials and hypo-exponentials. My preference is to use the
> well-known branching Erlang approximation (exponential stages) to the hyper-
> and hypo-exponentials. In this approximation, a distribution is specified by
> its mean and coefficient of variation.
> 
> So far, what I've been able to come up with in a literature search has been
> something called the Expectation Maximization algorithm. And I haven't been
> able to locate R code for this. So my questions are:

> 1. Is EM the "right way" to go about this, or is there something better?

Even for normal mixtures, direct likelihood maximization was considered to 
be better in several studies.  The EM method converges notoriously slowly.

> 2. Is there some EM code in R that I could experiment with, or do I need to
> write my own?

It's not an algorithm (despite its common name) so cannot be coding
generically.  There is EM code for normal mixtures in several places, e.g.
in packages emclust and mda.  Direct ML would be easier to code, I expect.

> 3. Is there a way this could be done using the existing R kernel density
> estimators and some kind of kernel that is zero for negative values of its
> argument? 

No, but there are ways to do by transforming the x scale.  Local 
polynomial estimators (KernSmooth, locfit) will do better.  For all of 
these see MASS (the book) and its on-line complements.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list