Contents Previous Next Subchapters Current Chapters-> fourier kalman_bucy filter mlmode_filter arcov fspec dpss wavelet iwavelet fnbut fncheb fnbpole fncpole fn2cbp fn2clp fc2dig fn2dbp fn2dlp Parent Chapters-> Omatrix6 filtering arcov Search Tools-> contents reference index search

Simulating An AR Process With A Specified Covariance
 Syntax `arcov(`N`, `M`, `r`)` See Also filter , snormal , fspec

Description
Returns M columns, each of which is a realization of a Gaussian AR process with an order that is one less than the row dimension of r, where N is an integer scalar specifying the number of points in each realization of the AR process, M is an integer scalar specifying the number of realizations, and r is a real or double-precision column vector such that for `L = 1` to the row dimension of r, the expected value of `x(i,j) * x(i + L - 1,j)` is equal to `r(L)`. The return value has N rows, M columns, and the same type as r. ``` ```If `x` is a Gaussian AR process of order `m`, there is a vector, `a`, such that ```      x = a  w  + a  x   + ... + a  x       n   0  n    1  n-1         m  n-m ```where the `{w(n)}` are independent, normal, and have a mean of 0 and a variance of 1.

Example ```      N = 200      M = 1      r = {1., .9}      y = arcov(N, M, r)      gtitle("AR(1) Simulation")      gplot(seq(N), y, "plus") ``` returns the following plot: ``` ```