Bayesian learning and the optimal investment decision of the firm