6
$\begingroup$

My data set is about user creating files during one year. Frequencies are

number of files / freq
 0   49
 1   36
 2   42
 3   26
 4   22
 5   22
 6    8
 7   12
 8    2
 9    4
10    7
11    0
12    1
13    1
14    1
15    1
16    2
17    1
18    0
19    1
20    0

What is most suitable distribution for this data set. I excluded vecation days since, and Saturday and Sunday. Distribution is needed to model this user in simulation. My row data enter image description here clearly you can see that vacation is from 15.07 until 18.08 that s why there is empty part on chart.

$\endgroup$
2
  • 3
    $\begingroup$ There's no single "most suitable" distribution across all purposes. It really depends on what you're doing, how simple a model you want, why you want an explicit model (rather than say a smoothed empirical pmf) and so on. What's this for? Is it an exercise for some class? $\endgroup$
    – Glen_b
    Commented May 30, 2017 at 7:09
  • $\begingroup$ I am trying to model user for simulation of storage distribution system that will be peer to peer based system $\endgroup$
    – explorer
    Commented May 30, 2017 at 7:16

1 Answer 1

14
$\begingroup$

Two common distributions for count data are the or the one. If we fit these to your data, the NB works a lot better:

library(MASS) # for fitdistr()

xx <- 0:20
counts <- c(49, 36, 42, 26, 22, 22, 8, 12, 2, 4, 7, 0, 1, 1, 1, 1, 2, 1, 0, 1, 0)
obs <- rep(xx,counts)

poisson.density <- length(obs)*dpois(xx,mean(obs))
nb <- fitdistr(obs,"negative binomial")
nb.density <- length(obs)*dnbinom(xx,size=nb$estimate["size"],mu=nb$estimate["mu"])

foo <- barplot(counts,names.arg=xx,ylim=range(c(counts,poisson.density)))
lines(foo[,1],poisson.density,lwd=2)
lines(foo[,1],nb.density,lwd=2,col="red")
legend("topright",lwd=2,col=c("black","red"),legend=c("Poisson","Negative Binomial"))

counts

However, there seems to be a peak at zero. Might there be a separate process that leads to zeros? If so, you might want to look at , e.g., the zero-inflated Poisson (ZIP).

You say that you have already removed weekends. You might still have intra-weekly seasonality (e.g., on Fridays), so you might want to consider modeling these in a regression framework, e.g., using Poisson regression or negative binomial regression. Then again, this might be overkill.

Finally, if all you are interested in is simulation, you could simply resample from the data you already have. Or fit a semiparametric kernel density to your observed frequencies and sample from that.

$\endgroup$

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.