For a given set of parameters \theta, I am solving

numerically for x(\theta), then obtain simulated moments S(x(\theta)) (which is stochastic), minimizing

where D is the data moments.

The most costly step is solving the rootfinding problem in the first equation — I found that of course having a good starting point helps.

I am wondering about the following heuristic solution: maintain a list of (x_i, \theta_i) pairs I solved for, and for a new \theta', use the x_i from the “nearest” \theta_i, or a convex combination of several nearest ones.

This is the part I need help with: I can of course find the nearest x_i's numerically, but I am wondering if there is an existing data structure/implementation that would make it easier.

As for the dimensionality of the problem: x, \theta \in \mathbb{R}^7.