# Particle filter maximum likelihood with a discrete (Bernoulli) state variable, non-smooth loglikelihood

My model looks like this \begin{align} \begin{split} dY_{t} & = \sigma_{t} dW_{t} + Z_t dN_t \\ d\lambda_t & = \alpha(\lambda_\infty - \lambda_t)dt + \beta dN_t \end{split} \end{align} We discretize the model with an Euler scheme. Denote the observed returns with $y_t$ and the latent states with $x_t = (\lambda_t, \Delta N_t)$, \begin{align} \begin{split} y_t &\equiv Y_t - Y_{t-1} = \sigma_t \Delta W_t + Z_t \Delta N_t \\ \lambda_t &= \lambda_{t-1} + \alpha(\lambda_\infty - \lambda_{t-1})\Delta t+ \beta \Delta N_t \\ \Delta N_t &= \begin{cases} 0& \text{ with prob } 1-\lambda_{t-1}\Delta t \\ 1 & \text{ with prob } \lambda_{t-1}\Delta t \end{cases} %\begin{cases} %N_{t-1 } & \text{ with prob } 1-\lambda_{t-1}\Delta t \\ %N_{t-1 } +1 & \text{ with prob } \lambda_{t-1}\Delta t %\end{cases} \end{split} \label{eqn:model} \end{align} where $\Delta W_t = W_t - W_{t-1} \sim N(0, \Delta t)$ and $\Delta N_t = N_t - N_{t-1}$. To derive the transition density we start by nothing that the distribution of $\lambda_t$ is degenerate, conditioning on $\Delta N_t$, that is, \begin{align} \begin{split} p( x_t | x_{t-1} ) &= p( \lambda_t , \Delta N_t | x_{t-1}) \\ &= p( \lambda_t | \lambda_{t-1}, \Delta N_{t-1}, \Delta N_t )p( N_t | \lambda_{t-1}, \Delta N_{t-1}) \\ &= 1_{\{\lambda_t = \lambda_{t-1}+\alpha(\lambda_\infty - \lambda_{t-1}\Delta + \beta \Delta N_t)\}} \cdot p( \Delta N_t | \lambda_{t-1}, \Delta N_{t-1}) \\ \end{split} \end{align}

My question is the following: I want to estimate this model using simulated maximum-likelihood (Malik and Pitt 2011), how this is done is by setting up the particle filter and calculating the mean of the weights found in the filter. In their application the state variable is the stochastic volatility. Of course, the empirical CDF generated by the weights is discontinuous which leads to a discontinuity in the simulated ML. This is solved by fitting a piecewise continuous function through the empirical cdf (ECDF).

However, in my simple toy model, my state variable is simply a Bernoulli variable that is either 1 or 0. So my particles are also either 1 or zero. Is there any sensible way to make this ECDF continuous?

Malik, S., & Pitt, M. K. (2011). Particle filters for continuous likelihood evaluation and maximisation. Journal of Econometrics, 165(2), 190-209.

• Do you have a link to the paper. I cannot download papers when I am off-campus. Also, you might've discretized your SDE incorrectly. – Taylor Jul 6 '18 at 13:23
• @Taylor Could you point out the mistake I made in my discretization? – Rainymood Jul 6 '18 at 15:51
• wouldn't it be $Y_{t+1} - Y_{t} = \sigma_t \Delta W_t + Z_t \Delta N_t$? I think you're supposed to use the values of unctions at the left endpoints. – Taylor Jul 6 '18 at 18:08
• thank you for pointing out my mistake, i'll look further into it. but what do you think about the non-smooth loglik problem ? – Rainymood Jul 7 '18 at 14:53
• sent you a private email or share link on dropbox – Rainymood Jul 9 '18 at 10:58

You probably don't want to make the original cdf $F$ for a discrete random variable into a continuous one, because then the new cdf $\tilde{F}$ won't correspond with a continuous random variable anymore. You will be changing your model. If $U$ is a standard uniform random variable, the sample $\tilde{X} = \tilde{F}^{-1}(U)$ is continuous, but $X =F^{-1}(U)$ is discrete. Recall that the inverse cdf for discrete random variables is a little bit weirder to find: $$F^{-1}(u) = \min_x\{x : F(x) \ge u\}$$ where $u \in [0,1]$. There will be many $u$'s such that all get mapped to the same number by $F^{-1}$ because $F^{-1}$ has some intervals on which it is flat.