title: How to fit autoregressive poisson mixed model (count time series) in R?
body: <p>My task is to assess how various environmental variables affect annual population fluctuations. For this, I need to fit poisson autoregressive model for time-series counts:</p>
  
  <p><img src="https://i.stack.imgur.com/YiIsS.png" alt="enter image description here"></p>
  
  <p>Where N<sub>i,j</sub> is the count of observed individuals at site <code>i</code> in year <code>j</code>, <code>x_{i,j}</code> is environmental variable at site <code>i</code> in year <code>j</code> - these are the input data, and the rest are parameters: <code>\mu_{i,j}</code> is the expected number of individuals at site <code>i</code> in year <code>j</code>, and <code>\gamma_{j}</code> is random effect for each year.</p>
  
  <p>Is it possible to fit such a model in R? I want to avoid fitting it in Bayesian framework since the computation takes way to long (I have to process 5000 of such models) I tried to transform the model for GLM, but once I had to add the random effect (gamma) it is no longer possible.</p>