obtain a favourable bias-variance trade-off for a certain choice of lag $\Delta$. Note that a too small lag gives a large bias in the estimate and a too large lag gives a large variance in the estimate; we return to this choice in Section \[sec:results\].

Numerical illustrations {#sec:results}
=======================

In this section, we provide illustrations of the properties of the FL smoother and the different proposed algorithms. The source code in Python and the data used for some of the numerical illustrations are available for download at: <http://liu.johandahlin.com/>.

Estimation of the log-likelihood and the gradient {#sec:results:flsmoother}
-------------------------------------------------

We begin by illustrating the use of the FL smoother for estimating the log-likelihood and the gradient. Here, we consider a linear Gaussian state space (LGSS) model given by

$$\begin{aligned}
    x_{t+1}|x_{t} &\sim \textsf{N} \Big( x_{t+1}; \phi x_{t}, \sigma_v^2 \Big), \\
    y_{t}  |x_{t} &\sim \textsf{N} \Big( y_{t};   x_{t}, \sigma_e^2 \Big).\end{aligned}$$

\[eq:lgss\]

We generate two data realisations of length $T=100$ using parameters $\theta^{(1)} = \{\phi,\sigma_v^2,\sigma_e^2\} = \{0.5,1.0,0.1^2\}$ and $\theta^{(2)} = \{0.5,1.0,1.0\}$ with a known initial zero state. We use the lag $\Delta = 5$ and run the PFs with systematic resampling [@CarpenterCliffordFearnhead1999].

![The log $L_1$-error in the log-likelihood estimates and the estimates of the gradient 