Distribute a fixed number of events to the days of a year following a specific distribution I am trying to distribute a given (fixed) number of events of a year over the respective year. The empirical distribution can be modelled with a Poisson distribution because there are usually only between 1 and 14 events per day.
I tried looping through the days of the year and generating a random number of events from a poisson distribution. The point at which I struggle is to distribute ALL events. If I overestimate the distribution, there are no events at all at the last weeks of the year and if I underestimate the distribution, there are several events left but they all need to take place in the considered year.
Is there any way to distribute all events?
Thanks a lot for your help and inspirations!

If I understand correctly, you have, say, N = 365 * 7 = 2555 events to distribute across each day of the year in such way that each day has a number of events given by a Poisson with, in this case, $\lambda = 7$.
For a simulation, you could assign to each of the 365 days a weight given by a random draw from the desired distribution, e.g. $Poisson(\lambda = 7)$, or any distribution really. Then distribute the events accordingly. Here's the code R:
smart.round <- function(x) {
  # Round vector x while keeping the sum of the rounded output the same as
  # input. Credit: https://stackoverflow.com/a/32544987/1114453
  y <- floor(x)
  indices <- tail(order(x-y), round(sum(x)) - sum(y))
  y[indices] <- y[indices] + 1
  y
}

N <- 365 * 7

pp <- rpois(n= 365, lambda= 7)
pp <- pp/sum(pp)

# Distribute events. Make final sum equals N after rounding
year <- smart.round(pp * N)

hist(year, xlab= 'N events', ylab= 'N days')


