Solution (source code)

= Solution

Iterating the <autoregressive process of order one> gives
$$
X_j=a^jx+b\sum_{\ell=0}^{j-1}a^\ell+\sum_{r=1}^ja^{j-r}\xi_r.
$$
For $q_r=\sum_{j=r}^t\theta_ja^{j-r}$, regrouping the sum of the exponents gives
$$
\sum_{j=1}^t\theta_jX_j=x\sum_{j=1}^t\theta_ja^j+b\sum_{r=1}^tq_r+\sum_{r=1}^tq_r\xi_r.
$$
The <independent> innovations factorize the <moment-generating function>. Consequently
$$
\boxed{A_t=\sum_{j=1}^t\theta_ja^j,\qquad B_t=\sum_{r=1}^t\bigl(bq_r+\psi(q_r)\bigr),\qquad q_r=\sum_{j=r}^t\theta_ja^{j-r}.}
$$
Finite sums avoid a division by $a-1$, so these formulas include $a=0$ and $a=1$; zeroth powers in these sums are $1$.