The dynamics of pharmaceutical regulation and R&D investments