# How to update an EKF when no inputs are available?

I'm using an Extended Kalman filter where the motion model is a function of the states and the inputs, with additive white noise, i.e. $$x_k = f(x_{k-1},u_{k-1}) +\delta_{k-1} \quad , \quad \delta_{k-1} \sim N(0,\Delta_{k-1})$$

If $x_{k-1}$ and $u_{k-1}$ are know, then the prediction step is done as $$\hat{x}_{k|k-1} = f(\hat{x}_{k-1|k-1},u_{k-1})$$ $$f' = \frac{\partial F}{\partial x_{k-1}}\Big|_{x_{k-1}=\hat{x}_{k-1|k-1}~,~u=u_{k-1}}$$ $$P_{k|k-1} = f'P_{k-1|k-1}f$$

However, at some time steps I won't know the value of $u$, the input. What is the optimal way to perform the prediction step in this scenario?

My thoughts so far are to set $$\hat{x}_{k|k-1} = \hat{x}_{k-1|k-1} ~,$$ since I have no new information to update it... but no idea how to estimate the covariance matrix $P_{k|k-1}$.

You can use the last value $u_{t-1}$ if the time step is not too big ($\delta t$ is small).
Or, you can keep track of $u$ some time steps in the past, e.g. ten of them and extrapolate $u_t$ when you lose it. You can use a line equation for that:
$$y = mx + b$$
You can use a simple linear regression to find the values of $m$ and $b$.