Dynamic Data Assimilation: A Least Squares Approach