# How to generate time series given its autocorrelation?

How can I generate a stationary Gaussian Random sequence/series that have the given autocorrelation? I have found that Autoregressive model can do the job but How to decide the order and coefficient of the AR model?

• Given the autocovariances, you can get the corresponding AR coefficients by solving the Yule-Walker equations. – javlacalle Mar 17 '17 at 11:27
• There is one problem, the given autocorrelation function is continuous (said the random series is sampled from continuous signal); if I try to sample this function value, the matrix and vector will be very large; and then Matlab seems to solve the a=R^(-1)r incorrectly. What can I do now? – Ervine Mar 17 '17 at 12:59
• I don't know. Posting the autocorrelation function that you mention may help others to give you an answer. – javlacalle Mar 17 '17 at 13:21