# Generate an autocorrelated Gamma sample of length N

How does one simulate an autocorrelated Gamma sample of length $$N$$? All I found online was about generation correlated variables and not an autocorrelated sample.

• There are a great many ways to do this depending on the purpose. Could you therefore explain why you're trying to do this and tell us what properties this process ought to have and what assumptions you are making about it? – whuber Dec 17 '18 at 16:08
• @whuber, the only condition I need is to have an autocorrelated Gamma sample with an autocorrelation at lag 1 going from 0 to 0.9. I'm doing some simulations in order to test the performance of a certain test. – Nooob Dec 17 '18 at 16:31
• Okay. Could you explain your remarks about generating "correlated variables and not ... autocorrelated sample"? What distinction are you making here? If you have mathematical expressions for constructing a stochastic process, then usually the steps for generating realizations of that process are obvious and immediate. Exactly what technique did you find online for generating autocorrelated Gamma variables? – whuber Dec 17 '18 at 16:36
• @whuber, What I found online was about generating autocorrelated random variables using copulas, the result of these simulations were vectors of multiple random variables (a matrix). What I want is simulate a sample of length $N$, $X_1, X_2, \ldots , X_n$ shuch that I have an autocorrelation equal to 0.5 per say, at lag 1. – Nooob Dec 17 '18 at 16:39
• Do you need the $X_i$ to have identical gamma distributions, or could they have different gamma distributions? If they are allowed to differ, how can they differ? (In scale, shape, or both?) – whuber Dec 17 '18 at 17:00