# Two sample K-S test as an alternative to maximum likelihood

I have a model with 3 parameters that I would like to fit to my (unidimensional iid) data. The model is a Hidden Markov Model and therefore it is intrinsically probabilistic. It is fairly straightforward to simulate samples from it. However, given the functional form of the transition and emission probabilities, it is very troublesome to obtain the likelihood function.

So I was thinking, what if I simulate $n$ iid samples $\mathbf{y}={y_1,y_2,...,y_n}$ from the model and then compare it with my sequence of $m$ iid observations $\mathbf{x}={x_1,x_2,...,x_m}$ with a two sample K-S test to check if they are drawn from the same distribution? Then I could find the set of parameters that minimize the $D_{nm}$ statistic coming from the K-S test.

How does this compare to maximum likelihood? Would this method have any clear disadvantages? Is there a preferred size $n$ of the simulated samples that would optimize the method according to $m$?

• I am curious how you would go about finding those parameters, since your objective function isn't differentiable and can be computed only approximately. I suspect the solution would (in general) be a large set of parameters even if you could compute the objective function exactly. – whuber Aug 24 '16 at 14:20
• Assuming $D$ would be concave, I would create a grid for the parameters and iterate over it until I find the minimum, or use something more sophisticated like fminsearch in matlab. – J. R. C. Aug 24 '16 at 14:29
• Your computational requirements will be enormous, because simulation will only approximate the distribution poorly unless $n$ is huge. – whuber Aug 24 '16 at 14:43
• Do you think that a particle filter (sequential MC) approach is generally more adequate? (In line with what @Alf suggested) – J. R. C. Aug 24 '16 at 16:18