Optimal risk allocation for regulated monopolies and consumers