Kernel and Moment Based Prediction and Planning : Applications to Robotics and Natural Language Processing