This paper proposes a recursive elimination method for optimal filtering problems of a class of discrete-time nonlinear systems with non-Gaussian noise. By this method, most of the computations to solve an optimal filtering problem can be carried out off-line by using symbolic computation based on the results from algebraic geometry. This property is suitable for moving horizon estimation, where a certain optimal filtering problem must be solved for different measurement sequences in each sampling interval. A numerical example is provided to compare the proposed method with other state estimation methods including the particle filter, and the efficiency of the proposed method is shown.