# Constructing a discrete time stochastic process with certain autocorrelation

I am trying to construct a discrete time stochastic process from which I can generate time series to work with. The stochastic process should have low autocorrelation everywhere but on certain lags (e.g at lags 7, 14, 21, etc. the autocorrelations should be high / significant and at the other lags the autocorrelations should be small / not significant). This is the only requirement on the stochastic process. Is there a simple way to do this?

Moving average (MA) process with nonzero coefficients at lags 7, 14, 21, etc. is just what you need. I.e. $$x_t=u_t+\theta_7 u_{t-7}+\theta_{14} u_{t-14}+\theta_{21} u_{t-21}$$ where $u_t$ is i.i.d. noise and the $\theta$s are scalars. Below is an example code for R:

n=1e4 # sample size
theta=rep(0,21); theta=0.4; theta=-0.6; theta=0.8 # coefficients theta
set.seed(1) # fix seed for random number generation
u=rnorm(n) # generated i.i.d. standard normal noise
x=u[1:(n-21)]+theta*u[(1+7):(n-21+7)]+theta*u[(1+14):(n-21+14)]+theta*u[(1+21):n] # generate the MA process
acf(x) # autocorrelation function (produces a graph) If you would like a stationary process of this kind then the simplest thing to do is just to specify an admissible auto-correlation function $\gamma(k) \equiv \mathbb{Corr}(Y_t, Y_{t+k})$ for your process with the desired auto-correlation values and then define the distribution of your observable series directly:

$$\boldsymbol{Y} = \begin{bmatrix} Y_1 \\ Y_2 \\ \vdots \\ Y_T \end{bmatrix} \sim \text{N} \Bigg( \begin{bmatrix} \mu \\ \mu \\ \vdots \\ \mu \end{bmatrix} , \sigma^2 \begin{bmatrix} \gamma(0) & \gamma(1) & \cdots & \gamma(T-1) \\ \gamma(1) & \gamma(0) & \cdots & \gamma(T-2) \\ \vdots & \vdots & \ddots & \vdots \\ \gamma(T-1) & \gamma(T-2) & \cdots & \gamma(0) \end{bmatrix} \Bigg).$$

You have to be careful to define your auto-correlation function so that the variance matrix for the process is admissible; this requires you to ensure that every variance matrix formed for the process is a symmetric real non-negative definite matrix.