Estimating Dynamic R&D Demand: An Analysis of Costs and Long-Run Benefits