MLE estimation script for TD