Optimal energy investment and R&D strategies to stabilize atmospheric greenhouse gas concentrations