  We consider a stable but nearly unstable autoregressive process of any order.
The bridge between stability and instability is expressed by a time-varying
companion matrix $A_{n}$ with spectral radius $\rho(A_{n}) < 1$ satisfying
$\rho(A_{n}) \rightarrow 1$. In that framework, we establish a moderate
deviation principle for the empirical covariance only relying on the elements
of $A_{n}$ through $1-\rho(A_{n})$ and, as a by-product, we establish a
moderate deviation principle for the OLS estimator when $\Gamma$, the
renormalized asymptotic variance of the process, is invertible. Finally, when
$\Gamma$ is singular, we also provide a compromise in the form of a moderate
deviation principle for a penalized version of the estimator. Our proofs
essentially rely on truncations and deviations of $m_{n}$--dependent sequences,
with an unbounded rate $(m_{n})$.
