  We propose a variational method to solve all three estimation problems for
nonlinear stochastic dynamical systems: prediction, filtering, and smoothing.
Our new approach is based upon a proper choice of cost function, termed the
{\it effective action}. We show that this functional of time-histories is the
unique statistically well-founded cost function to determine most probable
histories within empirical ensembles. The ensemble dispersion about the sample
mean history can also be obtained from the Hessian of the cost function. We
show that the effective action can be calculated by a variational prescription,
which generalizes the ``sweep method'' used in optimal linear estimation. An
iterative numerical scheme results which converges globally to the variational
estimator. This scheme involves integrating forward in time a ``perturbed''
Fokker-Planck equation, very closely related to the Kushner-Stratonovich
equation for optimal filtering, and an adjoint equation backward in time,
similarly related to the Pardoux-Kushner equation for optimal smoothing. The
variational estimator enjoys a somewhat weaker property, which we call ``mean
optimality''. However, the variational scheme has the principal
advantage---crucial for practical applications---that it admits a wide variety
of finite-dimensional moment-closure approximations. The moment approximations
are derived reductively from the Euler-Lagrange variational formulation and
preserve the good structural properties of the optimal estimator.
