# Simulate non-stationary time series with cointegration

how can I simulate/generate two non-stationary time series (with unit root) so that they can be also cointegrated (using R or Matlab).

-
–  user508 Aug 10 '14 at 19:18

Two cointegrated series contain a single unit root. Each series can be formulated as the sum of a common unit root plus a stationary component. Most textbooks covering cointegration will cover such formulations - see Hamilton's (1994) discussion of Phillips' "triangular representation" of a cointegrated vector, for example.

Simulating is likely to be easy (depending on other features you may need, of course). For example, simulate one non-stationary series, and construct a second series as the sum of the first and a stationary variable. Viola! Cointegrated.

-