Optimal regulation of lumpy investments