Approximate Solution of a Class of Optimal Estimation Problems via Nonlinear Programming and Sampling Techniques