TITLE: How can I generate the simulated time series
QUESTION [6 upvotes]: I am curious how one can generate simulated time series data. I found a list of simulated series here and a similar tool for stock market. What is the best way to generate domain specific time series data with some desired patterns? How should one approach this problem? I know this question is not very complete yet so please feel free to suggest modifications.

REPLY [4 votes]: An example: Simulate an AR1 process in MATLAB by
alpha = 0.8; % smaller than 1 for stationarity`
sigma = 1.3;

M = 1e3; X = zeros(M, 1); X(1) = randn; % Initialize

for k = 2:M
    X(k) = alpha*X(k-1) + randn*sigma;
end

This generates M points in time of the model:
$$X_k = \alpha X_{k-1} + \sigma u_k,$$
where $u_k$ is a standard normal variable. A simple model and a good starting point in simulating time series.