An analysis of linear models, linear value-function approximation, and feature selection for reinforcement learning