\documentclass{article}
\usepackage{times}
\begin{document}
\title{Notes on estimating models with unit-roots}
\author{Michel Juillard}
\maketitle

It is now possible to estimate with DYNARE models with unit-roots. These models must satisfy the following restriction: the dynamics of stochastic trends must be (log)--linear and the dynamics of the stationary part around the stochastic trends may be non-linear. 

\section{Steady state}

For stationay models, DYNARE linearizes around the steady state, using the internal function dynare\_solve.m. When the dynamics of the stochastic trends doesn't contain a deterministic trend (when it is a pure random walk without displacement), there is an infinity of value of $\bar y$ satisfying $f(\bar y)=0$ and it is possible to specify one of them in INITVAL.

When the stochastic trends contain a deterministic trend, there is no solution to the equation $f(\bar y)=0$. It is then necessary to provide DYNARE with a hand written function called \emph{fname\_steadystate.m} that returns the steady state values of the stationary variables and 0 for nonstationary variables when the model is linearized or 1 for nonstationary variables when the model is log--linearized. The variables must be ordered in alphabetical order. See /examples/fs2000a\_steadystate.m for an example. This procedure is cumbersome and we will be trying to automatize it in the future.

\section{Estimation}

For initializing the Kalman filter and for computing the smoother, DYNARE uses now the algorithm described in chapter 5 of J. Durbin and S.J. Koopman (2001) and in S.J. Koopman and J. Durbin (2003). Following the advice of these authors, we prefer it to the augmented filter advocated by De Jong. Note that the results are identical.

In DYNARE, it is necessary to declare the stochastic trends thru the following statement:
\begin{quote}
  options\_.unit\_root\_vars = {'P\_obs'; 'Y\_obs'};
\end{quote}
This syntax is temporary and will be made more DYNARE-like.

It is also necessary to set the option lik\_init=2 in the estimation statement.
In the future, this should be triggered automatically from the declaration of a stochastic trend.

It is also necessary to declare the deterministic components of the stochastic trends with the OBSERVATION\_TREND instruction (see /examples/fs2000/fs2000a.mod)

The new functions are
\begin{itemize}
\item DgesLikelihood.m: replaces mj\_optmumlik for filtering
\item DiffuseLikelihood1.m
\item DiffuseLikelihood2.m
\item DiffuseLikelihoodH1.m
\item DiffuseLikelihoodH2.m
\item DiffuseLikelihoodH3.m
\item DgseSmoother.m: replaces mj\_optmumlik for smoothing
\item DiffuseKalmanSmoother.m
\item DiffuseKalmanSmootherH.m
\end{itemize}
They still need thorough testing.

\section{Examples}

DYNARE is now able to estimate purely backward models, in addition to forward--looking models. The first two examples are such to isolate the problematic of estimating nonstationary models from the difficulties of estimating forward--looking rational expectation models.

\subsection{Two unrelated random walks}
Artificial data (10000 observations) are generated by /examples/arima/mod1.mod for
\begin{eqnarray*}
  dx_t = 0.5dx_{t-1}+{e_x}_t\\
  dy_t = -0.3dy_{t-1}+{e_y}_t\\
  x_t = x_{t-1}+dx_t\\
  y_t = y_{t-1}+dy_t
\end{eqnarray*}

mod1a.mod estimates this model when $dx_t$ and $dy_t$ are observed, and
mod1b.mod when the level of the data, $x_t$ and $y_t$, are observed. As expected, the results are the same.

\subsection{A cointegrated system} 

Artificial data (10000 observations) are generated by /examples/arima/mod2.mod for
\begin{eqnarray*}
  dx_t = 0.5dx_{t-1}-0.1(x_{t-1}-y_{t-1})+{e_x}_t\\
  dy_t = -0.3dy_{t-1}+0.2(x_{t-1}-y_{t-1})+{e_y}_t\\
  x_t = x_{t-1}+dx_t\\
  y_t = y_{t-1}+dy_t
\end{eqnarray*}

mod2a.mod estimates this model when $dx_t$ and $dy_t$ are observed, and $x$ and $y$ are treated as unobservable variables. The estimation procedure fails as the data is first difference don't contain any information about the initial level of $x$ and $y$.

mod2c.mod again estimates this model when $dx_t$ and $dy_t$ are observed, but the model is reparametrized so as to have the cointegration error as stationary unobservable variable.

mod2b.mod estimates the model with data in level: $x_t$ and $y_t$, are observed.In this case, and on moderate samples (100 observations), data in level provide additional information on the cointegrating relationship. 

\subsection{Schorfheide, 2000}

fs2000.mod estimates the CIA model of Schorfheide (2000) with observation of the rate of growth of prices and output. fs2000a.mod estimates with data in level. The posterior mode of parameters is somewhat different.


\section*{References}
\begin{description}
\item J. Durbin and S.J. Koopman (2001) \emph{Time Series Analysis by State Space Methods}. Oxford: Oxford University Press.
\item S.J. Koopman and J. Durbin (2003) ``Filtering and Smoothing of State Vector for Diffuse State Space Models'' in \emph{Journal of Time Series Analysis}, \emph{24}, pp. 85-98.  
\end{description}

 
\end{document}
