Estimating a Trending Ornstein–Uhlenbeck Model with a Kalman Filter
Summary
The document discusses estimating a bivariate trending Ornstein–Uhlenbeck process when one component is unobserved. It describes casting the discrete process as a state-space model and using maximum likelihood with a Kalman filter, then raises concerns about parameter stability and negative volatility estimates from repeated optimizations. The example reports divergent parameter estimates and Hessians that produce invalid confidence intervals, based on roughly 200 return observations.
The response suggests reconsidering the state-space formulation and simulating data from the proposed equations before fitting the model. In the author’s experiments, Kalman-filter maximum-likelihood fitting did not work properly in either R’s FKF package or Matlab. The discussion is exploratory rather than a validated comparison: it gives no definitive corrected formulation, diagnostic procedure, or successful estimation results. It also does not establish whether the instability comes from the equations, constraints, optimization settings, or limited data.
Key ideas
- An unobserved component in a bivariate trending Ornstein–Uhlenbeck process can be represented as a latent state in a state-space model.
- The document proposes Kalman-filter maximum likelihood as an estimation approach for the discretized process.
- Different starting values produced inconsistent estimates, while some fitted volatility parameters were negative.
- Hessian-based confidence intervals were unreliable when the estimated Hessian led to invalid calculations.
- Simulating data from the state-space equations is suggested as a way to diagnose estimation problems.
Tags
Full text
# Have I used correct state space formulation of Bivariate Trending OU process for Kalman Filter estimation?
# Have I used correct state space formulation of Bivariate Trending OU process for Kalman Filter estimation?
Introduction
I'm trying to estimate the parameters of an Ornstein Uhlenbeck process for a risky asset using the Kalman Filter but have doubts about the state space formulation that I am using. Also, though the optimization routine usually converges, it is not producing consistent results (I seed it using random values of a0). I set out the state space formulation below and a sample of the results that I've obtained. I'd be grateful for comments.
Background:
Lo and Wang's 1995 paper "Implementing Option Pricing Models When Asset Returns Are Predictable" talk about a bivariate trending Orstein Ulhlenbeck process. Formulae 47 and 48 in the paper re-expresses the SDE in discrete form as follows:
Note that the Xk series is not observable in the case that I am considering.
Also note that Lo and Wang suggest that "the parameters of this discrete-time process may be estimated by maximum likelihood by casting equation (51) in state space form and applying the Kalman Filter". (Equation 51 is simply equations 47 and 48 written in vector form.)
State Space formulation:
We've around 200 observations of returns in the qk series which are the result of taking the log of the original price series and removing the mean.
I've used the following state space formulation for the Kalman filter:
Question: Does this look right to you?
Results using FKF
I've used the R FKF and optim routines but do not seem to get stable results.
Here are examples of the output
Run 1:
```
gammaA deltaX lamda sigmaQ sigmaA
```
1.22281609 -0.02375487 0.82993795 -0.20981042 0.33695527
Hessian
```
gammaA deltaX lamda sigmaQ sigmaA
```
gammaA 145811.12 -59698.72 233025.83 4081125.686 -108014.073 deltaX -59698.72 1417438.95 245361.72 -115470.817 -77597.375 lamda 233025.83 245361.72 -66780.33 828819.093 -155588.44 sigmaQ 4081125.69 -115470.82 828819.09 -140434.978 -2393.24 sigmaA -108014.07 -77597.38 -155588.44 -2393.245 9394.849
Run 2:
```
gammaA deltaX lamda sigmaQ sigmaA
```
-0.2588449 -0.6517501 0.4049603 0.2003555 -0.3892163
Hessian
```
gammaA deltaX lamda sigmaQ sigmaA
```
gammaA -10649.06 298063.86 -1874109.00 -3086410.1 182300.504 deltaX 298063.86 111453.96 -65612.75 -170051.6 26122.721 lamda -1874109.00 -65612.75 -401617.84 304812.4 101798.308 sigmaQ -3086410.07 -170051.55 304812.40 337275.3 1084290.034 sigmaA 182300.50 26122.72 101798.31 1084290.0 1605.492
Obviously, apart from the stability problems, we have a problem with negative values of the sigmas, which are the volatilities of the process.
The Hessian is used to determine the confidence intervals for the estimates, and it is such that there are NaN's for some confidence intervals. However, that is not the focus for the moment.
Question: Any comments on these results and what might be going wrong?
## Answer by GerardF123 (score 1)
https://quant.stackexchange.com/a/38712
I've worked on this further and have the following thoughts:
- A better formulation of the state space equation (sse) is of the form:
(Yes, the matrices don't conform in the typesetting above. Sorry.)
The FKF package in R seems to force one to use the cumbersome formulation that I set out at the top.
Matlab allows the briefer formulation set out immediately above.
- Simulating the process from the sse above and then trying to fit it is a useful way of diagnosing problems. For the values I've investigated, the Kalman Filter with MLE methods did not work properly, either with R's FKF or Matlab.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.