0
$\begingroup$

Question

I have a sample of data (~250 values) which I think is geometrically distributed. Is there any statistical test that I can use to check if it is indeed geometrically distributed? Ideally included in a python library.

Things I have tried / considered so far

  • I have done a probplot, which looks promising. However this does not allow me to do hypothesis testing or does it?
  • I have considered transforming it into another distribution, but not sure which one and if this can be done. Poisson should be possible, though that will decrease my amount of data a lot.
  • I looked into tests to compare distributions, and then compare it to the same number of variables sampled from e.g. numpy.random.geometric. However I only found the z-test which seems to only work for normally distributed values? Or does it work for all? And if it does, is this a valid approach?
  • I looked into kolmogorov smirnov test but it seems to only work for continuous distributions, however mine is discrete. Could I still use the exponential distribution and treat my discrete values like they are continuous?

Edit

To be a bit more concise in what I am doing. I am modeling an auction based electricity market. If there are any problems in the grid, these auctions may be called.

To borrow from this question, it looks a bit like this:

|------------------------------------------------------------------------------------|
  [---]     [-----] [-]     [--------]    [-----]                 [--] [-]     [---]

The auctions are called, then have some duration, and then end. I have checked a variety of data sources if they correlate with when this auction is called and could not find much. Instead, I have done some investigations, and done stuff like a probplot which seems to show relatively well that indeed both the interarrival times between auctions and the duration of auctions seem to be geometrically distributed. However a probplot is visual and I was interested if there was some way I could formulate a hypothesis or some statistical test to underline the findings of this probplot.

Lastly, the reason I am so eager in attributing the observed data to some particular distribution is because I am developing a model to simulate said market. 'Knowing' the underlying distribution is thus very useful in developing said model.

$\endgroup$

1 Answer 1

2
$\begingroup$

Is there any statistical test that I can use to check if it is indeed geometrically distributed?

You cannot determine from data that something does have a particular distribution. Indeed for any sample, there's always an infinite collection of possible distributions that fit the data more closely than the distribution from which it came.

You can sometimes reasonably clearly tell that some data did not come from some specific distribution (that's what goodness of fit tests attempt to do, for example), but failure to find a difference doesn't imply that one wasn't there, only that you didn't have enough data to detect it.

Generally speaking, George Box's maxim applies: "Remember that all models are wrong; the practical question is how wrong do they have to be to not be useful."

Consequently, rather than focusing on the hopeless task of trying to demonstrate that a sample did come from a geometric distribution, the generally more useful approach is to avoid expecting it might actually be geometric in the first place, and instead focus on considering whether a geometric model might be a useful abstraction/approximation.

However, that's really the second step. The first step is to consider whether an explicit model is needed at all. In many cases a lot of progress can be made without needing an explicit parametric model like the geometric (e.g. for some purposes, the empirical distribution of the data itself may be sufficient).

If I wanted to convince someone that a process was geometric or at least very likely to be well approximated by it, I wouldn't focus on data but on the process assumptions necessary to get a geometric -- e.g. if we're looking at something that can be cast as the number of trials to the first success, I'd focus on the Bernoulli process assumptions for the trials. At best such an argument might be supplemented by some examination of data to show that it was also at least plausible from that side - but even then I wouldn't tend to use a formal test for that, it generally answers the wrong question.


While I would not typically suggest doing a goodness of fit test for the reasons outlined above (indeed they're generally not only not very useful for the purposes people tend to apply them for, in many cases they actively lead people into poor choices), nevertheless, a large number of such tests can be obtained.

An important consideration would be the kind of alternatives you'd want power against. If you have specific kinds of things that it might be instead (including "heavier tails" or even just "smooth deviations from the geometric"), it's possible to choose tests to have relatively good power against those alternatives. Or you might take a more generic approach and just consider the likelihood itself (or some transformation of it) as a test statistic.


What is not really addressed in your question is what you'd be using the geometric model for -- what problem it is an attempt to solve. A good answer to that sort of question often reveals a better approach.


A warning: don't use the exact same data to identify a model and to conduct testing, estimation or prediction on it. The selection step will interfere with the properties of the subsequent analysis that you'd be relying on.

$\endgroup$
5
  • $\begingroup$ Thank you a lot for the answer, it cleared some things up, especially in regards to not being able to prove its a given distribution but being able to show it is most likely not some other distriubtion. Lots of the things you said resonate with my idea. A geometric model indeed makes sense and would fit very nicely imo. Focussing on process assumption could be a good idea. I do need an explicit model, see update to my original question. I think i will do what you recommend and look if there are some specific things (heavy tails, ..) not fitting into the geometric picture. $\endgroup$
    – charelf
    Commented Mar 1, 2022 at 8:25
  • $\begingroup$ Thanks for updating your question, it is improved by the context. However, I see nothing in your post that implies that you must have a parametric probability model. I would not expect that these inter-event times would be geometrically distributed; I'd expect a continuous distributions. Exponential perhaps (and for that you would instead look at the Poisson process rather than the Bernoulli), but I wouldn't expect that it would be actually exponential (for all that it might perhaps be a quite serviceable approximation). $\endgroup$
    – Glen_b
    Commented Mar 1, 2022 at 10:31
  • $\begingroup$ The times are discrete and not contiuous since the auctions themselves are always announced at a given hour, so e.g. at 16:00, but never at e.g. 16:23. Hence taking 1 hour as the base unit, I have a discrete distribution. Why would you not expect it to be an exponential (or geometric, it does not particularly matter)? arent similar situation often modeled with exponential/geometric distribution? e.g. waiting times for a call center and similar? $\endgroup$
    – charelf
    Commented Mar 1, 2022 at 13:33
  • $\begingroup$ Thanks for clarifying my misunderstanding. In some situations, yes, they are definitely used; for the exponential, particularly where the Poisson process for event times is thought to be a reasonable model. However, just because a model is used doesn't mean that it's automatically suitable, (naturally), and the exponential is hardly the only inter-event time distribution that people use. I don't expect that calls for auctions will follow a homogeneous process, for example. $\endgroup$
    – Glen_b
    Commented Mar 1, 2022 at 22:49
  • $\begingroup$ Thank you for the continuous comments, I appreciate them and they help me identify situations where I may have come to a conclusion too early. That being said, I have strong belief that the exponential/geometric is suitable due to convincing results achieved with probplots. However on your last note I agree, this whole poisson process may be non-homogeneous, which I have also considered, however at this point of my work I am working on an initial base model, which I then potentially plan to extend in the future, in particularly with e.g. assumptions that the process is non-homogeneous. $\endgroup$
    – charelf
    Commented Mar 2, 2022 at 8:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.