So I have built code for an Unscented Kalman filter that can take any specified state and measurement dynamics. I have tested it on various linear problems and it works well, as expected. The main concerns I have is applying this filter to nonlinear parameter estimation problems.
When I have applied it to problems where I give a pretty good guess, it tends to do fine. However, more often when I don't have a good guess and make the covariance matrix elements larger, it tends to lose its positive definiteness and in turn fails to work.
Does anyone have tips on helping avoid these problems other than trial and error tuning of the various covariance matrices?
I have read papers about using the EKF/UKF for parameter estimation of weights in Neural Networks, for example. However, whenever I try to do this, I lose positive definiteness and it's frustrating because I struggle to reproduce the stellar results I see in the literature with respect to using the UKF for machine learning. Due to my failed attempts, I am questioning if it's really as useful as the literature appears to imply.
Note that I tend to formulate the problem like so for the parameter estimation problems I am looking at:
$$ \begin{align} \textbf{w}_{i+1} &= \textbf{w}_{i} + \mathbf{\eta}_w\\ \textbf{e}_{i} &= \text{H}(\textbf{w}_{i}) + \mathbf{\eta}_e \end{align} $$
where $\textbf{w}$ is the parameters being estimated and $\textbf{e}$ is some error generated by the parameters, where the expected value for $\textbf{e}$ is always $\textbf{0}$ (since I'm trying to find $\textbf{w}$ such that the error is as close to 0 as possible). $\text{H}(\cdot)$ also tends to represent a cost function that the underlying model is scored against as a function of the current parameters $\textbf{w}$.