Donato Carrieri

François

Application 3 : N = 2 regimes with a non-zero correlation ρ . 13

Introduction

I Introduction to corporate loans and corresponding mathematical models

Introduction

The prepayment option This PhD thesis investigates the pricing of a corporate loan according to the credit risk, the liquidity cost and the embedded prepayment option. When a firm needs money it can turn to its bank which lends it against e.g., periodic payments in a form of a loan. A loan contract issued by a bank for its corporate clients is a financial agreement that often comes with more flexibility than a retail loan contract. These options are designed to meet clients' expectations and can include e.g., a prepayment option (which entitles the client, if he desires so, to pay all or a fraction of its loan earlier than the maturity), a multi-currency option, a multi-index option, etc. On the other hand, there are also some mechanisms to protect the lender from the deterioration of the borrower's credit quality e.g., a pricing grid based on the borrower rating or protecting guarantees. The main option remains however the prepayment option and it will be the subject of this entire thesis.

In order to decide whether the exercise of the option is worthwhile the borrower compares the remaining payments (discounted at the interest rate he can obtain at that time) with the nominal value (outstanding amount of the loan) . If the remaining payments exceed the nominal value then it is optimal for the borrower to refinance his debt at a lower rate.

For a bank, the prepayment option is essentially a reinvestment risk i.e., the risk that the borrower decides to repay earlier his/her loan and that the bank can not reinvest his/her excess of cash in a new loan with same characteristics. So the longer the maturity of the loan, the riskier the prepayment option. Therefore, it is worthwhile to study long-term loans, some that are set for more than three years and can run for more than twenty years in structured finance. The valuation problem of the prepayment option can be modelled as an embedded compound American option on a risky debt owned by the borrower. We choose in this thesis to price a loan and its prepayment option by resolving the associated PDE instead of binomial trees or Monte Carlo techniques. Indeed, Monte-Carlo simulations are slow to converge to assess accurately the continuation value of the option during the life of the loan and binomial tree techniques are time-consuming for long-term loans.

Liquidity

When valuing financial products with medium to long maturity the robustness with respect to shocks and other exogenous variables is important. Among problems that have to be treated is the liquidity and its variability. Liquidity is a crucial ingredient towards the systemic stability of the financial sphere and can cause banks' failures if systemic liquidity squeezes appear. Historical events prove that banks hold significant liquidity risk in their balance sheets. Even if liquidity problems have a very low probability to occur, a liquidity crisis can have a severe impact on a bank's funding costs, its market access (reputation risk) and short-term funding capabilities.

Probably the most prominent characteristic of the liquidity is that it oscillates between distinct regimes following the state of the economic environment. Between two crisis, investors are confident and banks find it easier to launch their long term refinancing programs through regular bonds issuances. Thus the liquidity market is stable. Contrariwise, during crisis, liquidity becomes scarce, pushing the liquidity curve to very high levels which can only decrease if confidence returns to the market. The transition between these two distinct behaviours is rarely smooth and often sudden.

In order to model the presence of distinct liquidity behaviours we will simulate the liquidity cost by a continuous time discrete state Markov chain that can have a finite set of possible values, one for each liquidity regime.

From a technical point of view this paper addresses a non-standard situation: although the goal is to value an American option the payoff of the option is highly non-standard and is close to a compound option in spirit. As a consequence the characterization of the exercise region is not at all standard and technical conditions have to be met. Furthermore our focus here is on a specific type of dynamics (of CIR type) with even more specific interest on the situation when several regimes are present.

Thesis outline

The thesis is split in five parts :

The Part I delineates the banking environment: we start in Section 1 with the context and notions of corporate loan market, related works and the interest of the banking world for a better estimate of the loan price; then we present in Section 2 the description of the main financial risks with a focus on the credit risk; we explain in Section 3 the CIR process to model the dynamics of the default intensity and its calibration in Section 4; we continue in Section 5 the description of the liquidity component and we define the term structure of the liquidity in this model.

The Part II presents sufficient theoretical results concerning the prepayment option of perpetual corporate loans in a one-dimensional framework with constant interest rates. Numerical results that implement the findings are also presented and are completely consistent with the theory.

The Part III presents verification results that allows to certify the geometry of the exercise region and compute the price of the perpetual prepayment option in a two-dimensional setting with the short interest rate following a CIR dynamics. Moreover we show that the price is the solution of a constrained minimization problem and propose a numerical algorithm building on this result. The algorithm is implemented in a two-dimensional code and several examples are considered.

The Part IV presents an accurate pricing method of a corporate loan and its prepayment option in a finite horizon (non perpetual) multi-regime situation.

The Part V presents perspectives and conclusions.

Part I

Introduction to corporate loans and corresponding mathematical models [START_REF] Bielecki | Credit Risk: Modeling, Valuation and Hedging[END_REF] 1 Market of corporate loans

In this section, we start by providing the context of the corporate loans that are more flexible than bonds to manage the funding needs of companies.

Notions and context

Corporate loan

A loan granted by a bank to a large company is a financial agreement generally having a better flexibility than the loans granted to the retail customers. Indeed, there exist many options to fulfil the expectations of corporate customers, for example:

• the prepayment option which gives to the customer the right to refund all or part of its loan before its term,

• the utilization option in multi-currency,

• the utilization option in multi index,

• the extension option of a loan in terms of authorized amount or maturity... These various options may be valued in a qualitative way according to the borrower, in particular under a relational angle, and the practices of the market. On the other hand, there also exist mechanisms protecting the lender from a deterioration of the quality of the borrower in the form of financial guarantees or grids of invoicing showed that the rating of the borrower evolves.

A loan is either bilateral, i.e. an over-the-counter contract between one borrower and one bank, or syndicated, i.e. a contract between one borrower and a group of banks administrated by one arranger. Bilateral loans are confidential and only information on syndicated loans is available on the market. The opacity of the corporate loan's market can explain the lack of research on the subject of loans and options pricing. Moreover, unlike the market of mortgage loans, the granularity and the available history of the corporate loans are too low to be able to make a statistical analysis such as a Poisson regression, explanatory variables could be at the same time specific to the borrower (area, country, industry, EBITDA...) and to the economy (rate curve, curves liquidity, exchange rate, GDP...).

That is why another approach for the pricing of the prepayment option was chosen. In this thesis, we assume that the present value of a loan and the cost of its prepayment option are defined according to the intensity of default of the borrower, the short interest rate and the liquidity cost. Moreover, we model the prepayment option in order to give an accurate price of the loan. Indeed, the price of a loan will be defined as the present value of the remaining payments minus the cost of the prepayment option.

Reference rates: LIBOR and EURIBOR

The London Interbank Offered Rate (LIBOR) and Euro Interbank Offered Rate (EURIBOR) are daily reference rates based on the average interest rates at which banks can borrow funds from other banks respectively in the London money market and Euro money market. The LIBOR and EURIBOR are fixed on a daily basis and they are also calculated for several tenors from overnight to one year.

In the banking world, the interest rate of a loan is a constant commercial margin or more generally a constant commercial margin indexed on a shortterm interest rate (eg. EURIBOR or LIBOR) as the bond programs used by the banks to finance themselves. Therefore the banks are hedged against the short-term interest rate risk. Traditionally portfolio managers considered that the LIBOR or the EURIBOR (according to the currency of the loan) was the funding cost of the loan. Following the 2007-2008 liquidity crisis, it became clear that a short-interest rate cannot be a long-term funding cost for a loan because of the maturity mismatch.

Funding needs of a bank

The liquidity crisis of 2007-2008 highlighted the gaps in the current methods of assessment of the loans. Indeed, most banks tended to quantify only the credit risk of the counterparty whereas the commercial margin of a loan should also take into account:

• the liquidity cost which is the internal cost of a bank invoiced on its assets (e.g. a loan) to pay for its liabilities (e.g. a bond),

• the market price of the options associated with the loan.

The liquidity is the key of the stability of the financial system and can cause the bankruptcy of banks if a systemic liquidity crisis appears in the market. Historical events like the Asian crisis of 1997; the Russian crisis of 1998; the default of Hedge Funds such as LTCM; the bankruptcies of Enron, Worldcom and Lehman Brothers, the current crisis of the sovereigns, prove that the banks have a significant liquidity risk in their balance sheets. Indeed, even if a global liquidity crisis has a small probability of occurring, it can have a violent impact on the financing costs of all the banking system by contagion. Thus, a large number of banks could lose their market access (reputation risk) and the capacity to be financed in the short term. The liquidity risk of a bank is managed at the same time by the Asset Liabilities Management (ALM) department for the long-term funding and the Treasury department for the short-term funding. We will be interested here in the cost of the long-term liquidity, which is invoiced internally in each financing métiers of the bank. It is evaluated according to several specificities:

• the financing cost of the bank which comes from the interbank market for the short-term and the bond programmes for the long run. These costs depend not only on the economic state of the market but also on the credit quality and the notoriety of the banking institution.

• the level of deposit can allow, some borrowers having abundant funds, to reduce the liquidity cost invoiced. Therefore, a bank could offer a preferential liquidity cost to its clients on the local currency of its market. For example, a growing concern appeared in 2011 on the difficulty for French banks to fund their positions in dollar.

• the currency can also justify a different liquidity cost according to the bond issue price. Otherwise, a bank can use cross currency swaps rate to finance loans in foreign currencies without having to issue a bond.

• the types of commitments are multiple to fulfil the need of the borrower. There exist two main categories:

credit facility with a general corporate purpose or working capital uses (e.g. term loan, revolving credit facility, bridge to loan, bridge to equity...),

liquidity line that is an undrawn back-up facility put in place to refinance the debt of a customer when he/she is unable to obtain his/her ordinary course of business funding requirements in the financial market.

We will be interested here in the term loans, which are loans with a predetermined amount and a specified repayment schedule.

• the maturity of the commitment.

Prepayment option

The prepayment option is analysed in detail in order to fully determine the specific risks of this option. A customer, who owns a loan from a bank, has the possibility of refunding or prepaying the amount of the remaining debt of his/her loan before the end of the contract. This prepayment option, which can be total or partial, has an impact on the Banking Book of the bank which it is important to estimate. There exist two types of prepayment:

1. Financial or rational: prepayment related to the market (arbitrage), 2. Statistical: prepayment independent of the market (credit rating agencies penalize companies with too much short-term debts)

In most contracts, the borrower doesn't pay any premium or penalty to prepay his/her loan. In order to decide if it is optimal or not to exercise the prepayment option at a given moment before contractual maturity date, the borrower will compare the present value of the remaining cash flows (interests and principal) with the par value of the loan. If the payments exceed the par value then it is optimal for the borrower to prepay his/her debt at a lower rate. For a bank, this option is primarily a risk of reinvestment i.e., the risk that the borrower decides to prepay his/her loan and that the bank cannot reinvest its excess of liquidity in a new loan with the revenues. So, the longer the maturity, the higher the reinvestment risk.

The research on the loan pricing was thus focused on the assessment of liquidity costs and the prepayment cost option.

Bibliography

In the case of a term loan without option, the main risk present for the lender is the credit risk. Currently, this risk is well-taken into consideration by the banks and there exist many internal tools allowing them to accurately assess the revenues adjusted of the risk on such a loan. These decision tools are essential to grant a new credit application to a large company. There also exist external ratings of the credit quality of a company present on the bond market which are provided by the credit rating agencies (S&P, Moody's, Fitch...).

Liquidity risk

We refer to the work of L. Matz and P. Neu [START_REF] Matz | Liquidity Risk Measurement and Management: A Practitioner's Guide to Global Best Practices[END_REF] to a thorough presentation of the various processes to identify, measure, supervise and control the liquidity risk. It became essential for the banking institutions to prove that they have a strong position of liquidity to maintain the confidence of investors, credit rating agencies and regulators. Indeed, the liquidity risk became an integral part of the requirements of Basel III. A bank is mainly vulnerable to the liquidity risk when the long-term assets are funded with short-term liabilities coming from Money Markets considered to be very volatile; and when a bank grants authorization amount solely to increase its income. These new liquidity topics did not find a consensus within the academic world yet, and in particular, the behavioural analyses of corporate borrowers are not yet well defined. However there exist some new references on the matter eg., Leonard Matz and Peter Neu [START_REF] Matz | Liquidity Risk Measurement and Management: A Practitioner's Guide to Global Best Practices[END_REF]; and the work of Alexandre Adam [START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF]. The liquidity cost has also been studied in papers focusing on simple financial assets in presence of default risk, see Morini and Prampolini [START_REF] Prampolini | Risky funding: A unified framework for counterparty and liquidity charges[END_REF], see also Castagna [START_REF] Castagna | Funding, liquidity, credit and counterparty risk: Links and implications[END_REF]. Recently, a new side of the liquidity has been considered in an article by Brigo [START_REF] Brigo | Funding valuation adjustment: a consistent framework including cva, dva, collateral, netting rules and re-hypothecation[END_REF], to include funding costs into a risk-neutral pricing framework for counterparty credit risk.

The liquidity became recently a major subject for the banking world. In the past, the banks have financed their long-term assets with short-term liabilities provided by the Interbank lending market. The confidence and liquidity crisis of 2007-2008 compelled them to lengthen the maturity of their liabilities to reduce their liquidity risk and thus to regain the confidence of the investors. The absence of reference and technical documents is one of the main difficulties in the modelling of the evolution of the liquidity costs. In addition, it is difficult to assess these costs in a very incomplete market: indeed a few banks in difficulty continue to invoice their customers below their own financing costs.

Loan pricing and prepayment option: academic works

There exist few articles (e.g., works by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]) on the loan prepayment option but a related subject, the prepayment option in fixed-rate mortgage loan, has been widely covered in several papers by J.E. Hilliard and J.B. Kau [START_REF] Hillard | Valuing prepayment and default in a fixed-rate mortgage: A bivariate binomial options pricing technique[END_REF] and more recent works by Chen et al. [START_REF] Chen | The value of mortgage prepayment and default options[END_REF]. To approximate the PDE satisfied by the value of the prepayment option, they defined two state variables (interest rate and house price). Their approach is based on a bivariate binomial option pricing technique with a stochastic interest rate and a stochastic house value. Another contribution by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF] applies the binomial tree technique to corporate loans but of course it is time-consuming for long-term loans due to the nature of binomial trees. They consider a prepayment option with a 1 Year-loan discretized on a quarterly step but it is difficult to have an accurate assessment of the option price for a 10 Year-loan. There also exist mortgage prepayment decision models based on Poisson regression approach for mortgage loans. See, for example, E.S. Schwartz and W.N. Torous [START_REF] Schwartz | Mortgage prepayment and default decisions: A Poisson regression approach[END_REF]. Unfortunately, the volume and history of data are very weak in the corporate loan market. Due to the form of their approach, these papers did not have to consider the geometry of the exercise region because it is explicitly given by the numerical algorithm. This is not the case for us and our problem requires that particular care be taken when stating the optimality of the solution. Furthermore, to the best of our knowledge, none of these approaches explored the circumstance when several regimes exist. The analysis of Markov-modulated regimes has been investigated in the literature when the underlying(s) follow the Black& Scholes dynamics with drift and volatility having Markov jumps; several works are of interest in this area: Guo and Zhang [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] have derived the closedform solutions for vanilla American put; Guo [START_REF] Guo | An explicit solution to an optimal stopping problem with regime switching[END_REF] analyses in Russian (i.e., perpetual look-back) options and is able to derive explicit solutions for the optimal stopping time; Mamon and Rodrigo [START_REF] Mamon | Explicit solutions to European options in a regime-switching economy[END_REF] find explicit solutions to vanilla European options. Buffington and Elliott [START_REF] Buffington | American options with regime switching[END_REF] study European and American options and obtain equations for the price. A distinct approach (Hopf factorization) is used by Jobert and Rogers [START_REF] Jobert | Option pricing with Markov-modulated dynamics[END_REF] to derive very good approximations of the option prices for, among others, American puts. Other contributions include [START_REF] Yao | A regime-switching model for European options[END_REF][START_REF] Tak | Pricing currency options under two-factor Markov-modulated stochastic volatility models[END_REF], etc. Works involving Markov switched regimes and CIR dynamics appears in [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] where the bond valuation problem is considered (but not in the form of an American option; their approach is relevant to the computation of the payoff of our American option although in their model only the mean reverting level is subject to Markov jumps) and in [START_REF] Zhou | An accessible implementation of interest rate models with markov-switching[END_REF] where the term structure of the interest rates is analysed. On the other hand numerical methods are proposed in [START_REF] Huang | Methods for pricing American options under regime switching[END_REF] where it is found that a fixed point policy iteration coupled with a direct control formulation seems to perform best. Finally, we refer to [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF] for theoretical results concerning the pricing of American option in general.

Financial institution research on corporate loans

At the end of 2011, Markit and Euroclear Bank decided to bind together to create a platform to help the financial institutions to monitor and price the syndicated loans as collateral in financial transactions. Moreover, this partnership should develop tools to allow a better transparency and stability of the secondary market of the syndicated loans. Many descriptive studies on the evolution and volume of this market measurement should thus be published soon. We also expect some behavioural studies on the universe of the corporate loan such as the prepayments. Currently, only Bloomberg provides studies on the market of the syndicated loans eg., Bloomberg [START_REF]Global syndicated[END_REF]. However, they restrict the access to quotations of the secondary market. Indeed, a bank analyst will only be able to have access to internally shared quotations and not to all of them.

Impact on the banking world

A more accurate corporate assessment of the loans, according to their various natures and options, is interesting for multiple reasons, both at the accounting level and the management level. It will make it possible to facilitate:

• the application of Pillar II of the regulation Basle II concerning the liquidity, and implying a modelling of every funding asset (commitments of the bank to supply liquidity to a borrower, optional or not),

• the assessment of new applications for credit according to their nature and their options,

• the estimation of the fair value of the assets in the Banking Book,

• the estimation and negotiation on the primary and secondary market of the loans,

• the implementation of hedging techniques in agreement with IAS39 norm (accounting standards IFRS ).

Secondary market of the corporate loan

The French banks turn more and more to the secondary market to sell some of their corporate loans. The secondary loan market is an over-the-counter (OTC) market, therefore it is not organized and doesn't have a clearing house. That implies a considerable counterparty risk and an absence of information and pricing on treated volumes. However this market is not very active, firstly due to the limited number of players, essentially financial institutions, and secondly due to the complexity of the loans. In France, the financial institutions, like hedge funds and insurance companies cannot buy loans.

A loan has an assignment clause which restricts the conditions of sale to another bank; generally this clause implies that only a bank having a certain level of rating (in general investment grade) is authorized to buy out a loan. Moreover, this clause contains a condition called consent required, which often implies that the borrower has a veto right on the sales of his/her loan, subject to valid reasons. The loans are very specific financial instruments, unlike bonds; they are OTC agreements with very complex contractual rules.

Besides the options attached to the loan which make its specificity, it is also necessary to take into account the nature of the loan, the fact that it is syndicated with several banks involved or bilateral. This lack of liquidity is the main difficulty that we encountered because the market does not make it possible to calibrate or backtest models of assessment. Since very few loans are exchanged on the secondary market and a majority of them are kept in Banking Book, loans are often defined as Buy & Hold assets.

IFRS Norms (IAS 39) and Accounting mismatch

Most companies and financial institutions need to cover as well as possible the specific risks underlying to their own activities. With regard to the financial risks (interest rate risk, foreign exchange risk, credit risk, counterparty risk...), the hedging requires the use of derivative instruments that unfortunately create an accounting mismatch in the balance sheets of the bank.

In credit, the discordance takes place between the assessment in fair value of the loan and its hedge, the Credit Default Swap (CDS), which potentially creates a strong volatility of the Income statement (Profit and Loss statement). It is possible to limit it by estimating the loan price in Markto-Market (MtM),i.e. the Fair Value of the loan, and then the difference between the market variations of the loan value and of its hedge will be tiny. Fair Value is the price at which an asset can be issued or a liability can be reimbursed in an arms length transaction between two counterparties with the same level of counterparty and in normal competitive conditions Before 1973, the requirements for the financial statements were issued according to local norms that differ from one country to the other, there did not exist an international accounting reference framework. The divergences between the local accounting standards made difficult the comparison between the financial statements of companies. This lead to the creation of the authority in charge of the establishment, the issue and the promotion of accounting standards named IASC in 1973, and then renamed IASB in 2001. IASB thus allowed the harmonization of the financial statements facilitating the comparability between the competitors and a better transparency of the financial information for the investors. Norms IAS/IFRS relate to the listed companies of the European Union or the companies which has outstanding bond issues in the market.

We keep up the positioning of the various departments of loan portfolio management on this subject. Today, the majority of these banks completed the transition towards IFRS. One of the most difficult norms to understand and apply is the IAS 39 "Financial Instruments Recognition and Measurement". The IAS 39 requires taking into account derivative instruments in Mark-to-market. This can involve an accounting mismatch i.e., the bank loans are classified as "Loans and receivables" and assessed at the historical cost while the hedging instruments, such as CDS, are classified in "Trading" (Mark-to-market) and assessed in "Fair Value". The accounting mismatch between the loan and the CDS potentially creates a strong volatility of the Profit and Loss account (P&L). In order to reduce this discordance and a fortiori this volatility, two possibilities can be considered:

• Approach in Fair Value Option,
• Approach in Hedge Accounting.

Both approaches have pros and cons, so it is still currently in debate. However, it seems that the approach in Fair Value Option is the most widely used among the various credit portfolio managers. This topic is confidential and internal to each bank and as such there is no public documentation A market is active if it possesses the 3 following conditions:

• Its prices are public,

• Supply and offer meet continuously,

• Traded assets must be homogeneous, Currently, the transaction price of a loan is mainly based on credit risk, so it is far from the fair value. According to the previous diagram and the loan market attributes, it is therefore necessary to develop a pricing model for the Fair Value of each loan. The Fair Value approach is even more difficult to apply in a market where there is a competition bias, e.g. a French bank is at a disadvantage compared to US banks in the US dollar loan market since it does not have access to the US dollar funding at the same cost as its competitors.

The Hedge Accounting approach involves covering one of the risk components of the loan (credit risk, interest rate risk, counterparty risk...). For a term loan that has only credit risk, the hedging will be perfect. This process can replace the usual accounting treatment relating to derivatives (fair value in the income statement) or adjust the book value of assets or liabilities. But companies will be allowed to use the Hedge Accounting approach if they meet the numerous and complex conditions set out in IAS 39. It includes a clear and accurate demonstration of the effectiveness of the hedging instrument on the underlying asset. This approach can only hedge the market component of the loan and cannot be applied on the different existing options such as the prepayment.

With the aim of greater transparency and understanding of risks, it is appropriate to apply a global management of credit risk. Unfortunately, IFRS norms allow only sporadic actions and the restrictions produce volatility in the P&L which, in some circumstances, can be counterproductive strategies for risk management. One application of the thesis was to obtain an accounting approach of hedging instruments and their underlying assets more closely aligned with risk management. We searched for a procedure to better reflect the financial statements of a bank but among the various proposals under consideration to reduce the risk in accounting mismatch, none of the solutions was satisfactory. Even assessing the Fair Value of all components of risk of an underlying asset such as a loan would not reflect our risk management and would produce a mismatch between the hedging instrument and the underlying components (as they are not directly related to the market risk).

Asset & Liability Management

As seen previously, the prepayment option involves a refinancing risk for the bank. Indeed, the prepayment risk is the risk that a borrower decides to prepay all or part of the outstanding amount. Unlike the retail banking, there is generally no penalty for prepayment and it is a free option granted to the borrower.

The financial impact of prepayment is outlined by two main factors:

• Exogenous factor: that is the time decay impact through the life of the loan. According to the slope of the margin curve, the impact can be positive or negative for the bank.

• Endogenous Factor: during a crisis, the liquidity costs and credit margins are very high. Once the crisis is over the prepayment risk is at the highest level because a lot of loans could be prepaid. Indeed the corporate borrowers will be able to refinance their debts at a lower interest rate as soon as the crisis is over.

In the case of the prepayment, a reduction in the margin costs can cause a loss during the reallocation of this excess of cash. For the bank, the risk of prepayment is then a reinvestment risk and the longer the maturity, the higher the reinvestment risk.

According to different scenarii, the P&L impact sensitivity can be either positive or negative. P&L is sensitive to variations of liquidity costs and prepayment behaviour. Intuitively, we expect a decrease (increase) of prepayments if costs increase (decrease).

Cost

Prepayment very low probability very low probability

1. Scenario 1 : Liquidity costs are constant in time.

If the liquidity costs are stable, there is a weak reinvestment risk. Generally, the liquidity curve increases with the maturity. Following the prepayment occurrences, we can have two situations:

• Less prepayment than expected implies a profit. We need cash at a lower maturity than at issuance, so at a lower price.

• More prepayment than expected. We have an excess of cash but it can be reinvested in the new production. There is only a risk if the volume of the new stock is inferior to the excess of cash.

Scenario 2 : Liquidity costs increase

If the liquidity costs increase, we assume that it will result in a decrease of prepayment. We need cash at a lower maturity than at issuance, but according to the slope of the term structure, the price is not necessarily lower.

Scenario 3 : Liquidity costs decrease

If the liquidity costs decrease, we assume that it will result in an increase of prepayment. We have an excess of cash and the new stock can not compensate because of the decrease of liquidity cost. This scenario is the worst and the more difficult to forecast. We have two unknown variables:

• minimum liquidity cost: it was not really invoiced before the crisis due to a maturity mismatch between the assets and liabilities of the bank, therefore we assume liquidity costs can not reach the previous level.

• borrower behaviour : borrowers prepay less when liquidity costs increase significantly but what happens when cost will decrease? What is the maximum possible prepayment rate?

Financial risks and Credit risk

To understand what is the credit risk for a financial institution, it is essential to start by defining the principal financial risks. We develop the credit risk by introducing the default probability with an application to bond market.

The different types of financial risks

The market risk

It is the risk of losses in positions taken ("long" for purchase or "short" for sale) on financial instruments arising from fluctuations in market data (market price, credit spread, interest rate term structure, etc.). A financial instrument is a tradable asset categorized as a cash instrument (bonds, loans, stocks, etc.) or a derivative instrument (option on bond futures, equity futures, credit default swap, interest rate swap, ect.)

The operational risk

It is defined by the norms Basle II as the risk of loss resulting from inadequate or failed internal processes (information systems, human errors, frauds and ill will), people and systems, or from external events (accidents, fires, floods).

The liquidity risk

It is the risk that a financial institution doesn't have enough liquidity to respect its commitments towards its customers. It is crucial not to confuse liquidity with liquidation.

The liquidity risk represents a dominating part of financial risks since the 2007 crisis. Therefore, it became essential for the banking institutions to prove that they have a strong position of liquidity to maintain the confidence of investors, credit rating agencies and regulators. As a result, the liquidity risk became an integral part of the requirements of Basle III with the integration of two liquidity ratios: a short-term ratio LCR (Liquidity Coverage Ratio) and a long-term ratio NSFR (Net Stable Funding Ratio).

The liquidation risk

This risk is very different from the previous one. Well known since many decades, this risk occurs when a buyer or seller is no more able to convert his/her assets into cash to pay off all his/her obligations. It appears when, at the time of a transaction, the number of buyer and the number of seller diverge. So the range of "bid/offer" quotation increases.

The credit risk

Credit Risk associated to an obligor results from the combination of the obligor's default risk with the risk linked to the recovery in the event of default and to the unknown exposure at default. Default risk is the default probability of a given obligor on its overall obligations, over a determined time horizon. The recovery reflects, for each exposure, the expected recovery value of the facility in the event of default. The exposure at default represents the outstanding amount owed by the obligor at default, as anticipated at the time of assessment.

Definition of the different events of default

It is important to understand the different triggers involving the default of an obligor. Indeed, it can occur upon one of the following events:

• A probable or undoubted risk of payment default, likely to generate a partial or total non-recovery of the exposure (any amount due by the counterparty on a loan (principal, interest or fee), a market transaction or a contingent liability), without taking into account any of the potential recoveries resulting from the enforcement of collaterals or guarantees received. Furthermore, a probable or undoubted risk of payment default is identified in the following situations:

-A result of a credit event, the Bank accelerates the repayment of a loan (in case, for example of a cross-default event) or activates the early termination of a market transaction.

-The Bank sells all or a part of its exposure at a significant "Economic Loss" resulting from deterioration in the creditworthiness of the counterparty. This haircut must not only be due to a deterioration of the general market conditions.

-The Bank is forced to a "Distressed Restructuring" of its exposure because of a payment default risk on the counterparty, where this is likely to result in an "Economic Loss" caused by a significant haircut or a postponement of a significant part of the exposure. The counterparty is not considered in default if the Bank considers that the counterparty is likely to pay its financial obligations in full. A "non-distressed" restructuring consists for instance in re-negotiating the financial conditions with the intention of protecting business interests; or the restructuring does not result in a significant economic loss for the Bank, eg. when the rescheduling is done at the prevailing market conditions applicable to this counterparty.

• The existence of any uncured, missed or delayed payment (principal, interest, fees in the case of loans) outstanding for more than 90 or 180 days, according to the Basel II regulation, depending on the type of receivables.

• Any judicial, administrative or other proceedings (such as bankruptcy, insolvency, receivership, ect).

• Any protection from creditors which is sought or commenced against the counterparty (whoever requested it) and which might avoid, suspend, differ or reduce the counterparty's payment obligation (such as Chapter 9, Chapter 11, etc).

Definition of the default probability

In credit risk modelling, the most delicate part is assessing the default probability for various time horizons. These can be based on actuarial models or market prices of traded assets whose value is affected by default. There exist actuarial models that forecast default probabilities by analysing explanatory factors based on historical default rates. The most famous model is the Z-score by Altman (1968). It predicts the probability of bankruptcy using various accounting variables. Another, more sophisticated approach is that of credit-rating agencies, which classify issuers by credit ratings. The agency ratings traditionally reflect the obligors' default risk alone ("Issuer Rating") and the risk related to debt issues (obligor's default risk and expected recov-ery). These ratings are an assessment of the default risk of a counterparty based on its stand-alone credit standing following several rating criteria:

• Business risk: it reflects the country environment of the obligor (political, economic and social environment); the business sector and position of the counterparty within the sector and a management appraisal.

• Financial risk: it reflects the repayment capacity and the financing sources of the obligor.

To relate each rating to an actual default rate, credit rating agencies (S&P, Moody's, Fitch...) have calculated 20 year historical default rates and standard deviations for various time horizons. The classification, in Figure 2, is ranged from AAA for the best obligors to C for the riskiest one. A borrower with initial rating of BBB, for example, had an average 0.24 percent default rate over the next year and 4.88 percent over the next 10 years. Indeed, the speculative grade borrowers (from BB to C) have higher default rates than the investment grade ones (from AAA to BBB). Thus, it is possible to use this information as estimates of default probabilities for a given rating.

Even if the credit-rating agencies such as S&P, Fitch or Moody's are popular indicators to the investors, these ratings apply a Trough The Cycle approach, which smooth the extreme variations of the cycles (growth and/or recession). Thus it does not reflect the default risk on the market at a specific point in time.

Credit risk can also be calculated implicitly from the price of traded assets. Indeed the present value of these cash flows is impacted by default probabilities. This includes bonds, credit default swaps, and equities for the reference entity. Because the prices are set in freely functioning financial markets, they incorporate the expectations of traders about potential losses owing to default.

Application to the Bond market

Definition of the bond market

The bond market, although with less media exposure, is as important as equity market in term of volumes (mainly because of the important part of sovereign bonds). It represents the medium term and long term of the interest rate curve in the market. Contrary to an equity, a bond does not offer an ownership stake in the company but a part of the debt of the concerned issuer. A company having important financing needs can choose among several funding sources, either on the capital market (through capital increase or an initial public offering) or by debt financing. In this second possibility, the company will be able to either raise a loan from a bank or issue a new debt in the bond market. Through bond issuances, the company remains independent with respect to the banks and allows other types of investors to invest in the company. The bond market is a funding source used by companies, sovereigns, local governments and organizations.

Bond market-based model

The level of the credit spread of a bond at issuance is function of:

• Characteristics of the bond (amount, duration, currency, and options),

• Characteristics of the issuer (rating, sector of industry and nationality),

• Market data: interest rate curve and foreign exchange rates,

• Economic environment: the general climate of the economy has an effect on the relation established between the investor's risk aversion and the bond market, and consequently on the coupon required. Moreover, financial crisis can trigger a flight of the investors towards the safest investments and cause a liquidity crisis meaning an increase of the coupon rate.

For instance, consider the price of a zero coupon bond that has a significant probability of default. The figure 2.4.2 describes a simplified default process for this bond over one period in order to explain the static probability of default. At maturity, the bond can be either in default or not. The bond will pay recovery value R × 100 if a default occurs and the nominal value 100 otherwise. Let π be the cumulative default rate from now to maturity T under risk-neutral valuation (for more on risk-neutral valuation see Section 2.1. [START_REF] Elliott | Mathematics of financial markets[END_REF]). The risk-neutral probability π is defined by the property that the price of any financial instrument, here a zero coupon, is the actualisation of the average of its terminal value (the nominal value 100 or the recovery value R × 100). Note that the risk-neutral probability may not always exist or be unique. If bond prices carry no risk premium, the current price is simply the expected value of the two possible outcomes discounted at the risk-free interest rate. Define y * and y as the yields on the zero coupon bond and on an identical risk-free bond respectively. Hence,

P * = 100 (1 + y * ) T = (1 -π) 100 (1 + y) T + π R × 100 (1 + y) T (1)
The risky bonds are subjected to the credit risk besides the interest rate risk. In addition, the liquidation risk is also very important. Let's assume that there exist some firm on the bond market whose credit risk is null. The excess return of a risky bond compared to a risk-free bond, called credit spread, represents the premium required by the market to take into account the counterpart risk and the liquidation risk inherent to the instrument. Less liquid bonds, trading at a wider bid-ask spread, are less attractive to investors. Defaults happen more often when the economy is doing badly. As a result, a risky bond has some systemic risk, for which investors require an additional compensation or risk premium.

Expressed in basis points, the spread is defined more precisely as the difference between the yield to maturity of the bond and the reference rate of a" benchmark".

Two types of benchmarks were mainly used on the market:

• The reference rate of the government bonds (OAT, Bund), considered as risk free. Before the crisis, investors considered that the government bonds of the developed countries were a good proxy for the liquidity. Indeed, these bonds issued by the states, primarily in their own currency, were most liquid because they represented the main part of bond's transactions.

• The EURIBOR and LIBOR swap rates are still traditionally used as proxies for risk-free rates. John Hull and Alan White [START_REF] Hull | The derivatives discounting dilemma[END_REF] maintained that since the 2007-2008 crisis, this practice has been called into question. They explain that many banks now discount collateralized portfolios with overnight indexed swap (OIS) rate and, EURIBOR and LIBOR swap rates otherwise.

To simplify, let us drop second-order terms and assume that T = 1, hence the risk-neutral default probability π can be defined simply by the credit spread y * -y and the loss given default

(1 -R). π = y * -y 1 -R (2)
Therefore, it's straightforward to find the default probability π from the term structure of the bond yields and with some assumption about the recovery rate R. However this approach has some critical biases:

• it is difficult to assess the credit spread y * -y. This risk premium is the excess return on a risky bond relative to a theoretical return on a risk-free asset. Unfortunately, a risk-free asset doesn't exist because all financial assets carry some degree of risk. In the past, we used to consider treasury-bills as risk-free assets but it's now less obvious with the downgrade of the U.S.

• the bond has to be liquid enough on the public market to have a credit spread representative of the risk.

Instead of the bond market, we can use default-risk models based on equity market. This market has the advantage of generally proposing more liquid stocks and derivatives on a larger number of companies. The Figure 2.4.2 describes a basic Merton method [START_REF] Robert C Merton | On the pricing of corporate debt: The risk structure of interest rates[END_REF]. In this model, the value of the firm's assets is assumed to obey a Log-normal diffusion process with a constant volatility. The firm has issued two classes of securities: equity and debt. Assuming, the equity receives no dividends and the debt is a pure discount bond where a payment is promised at time T . We can split up the value of the firm V into debt D and equity E. The debt is an obligation that has to be repaid at a fixed price in the future at time T . If the value of the firm is insufficient to repay this debt, the firm is in default. In theory, the stock price then goes to zero.

Merton has shown that the firm's equity can be viewed as a call option on the value of the assets of the firm, with an exercise price given by the face value of the debt. Hence,

E T = max [V T -D, 0] (3)
The current stock price therefore embodies a forecast of default probability in the same way that an option embodies a forecast of being exercised. These kinds of models, which are based on the capital structure of the company, are called structural models. In particular KMV Moody's uses this approach to sell estimated default frequencies (EDF) for a large number of firms. The approach based on bond price yields is called a reduced-form model because it models the default probability directly.

Another alternative is to turn to default-risk models based on credit derivatives. We will develop this approach in Section 4.

Models of default intensity

Before developing a valuation model for a loan and its prepayment option, it is important to define the types of stochastic process of the default intensity of the borrower. The article of F.A. Longstaff and E.S. Schwartz [START_REF] Longstaff | Valuing credit derivatives[END_REF] highlights some major empirical properties allowing for spreads to be stationary and mean-reverting according to a historical data of credit spreads. In this Section, we discuss several process incorporating these properties to decide which one will give the more realistic pricing.

Intensity model

Let (Ω, H, {H t } t≥0 , P) be, a filtered probability space. We introduce the right continuous increasing process N t = 1 τ <t adapted to the filtration H t = σ(N s , s t) where τ is the stopping time that occurs at the instance of default of the borrower (for more details see Section 21.1.1 [START_REF] Brigo | Interest Rate Models -Theory and Practice: With Smile, Inflation and Credit[END_REF]).

Moreover N t is a submartingale and N 0 = 0.

E[N t |H s ] N s , ∀s < t (4)
Therefore, according to Doob Meyer theorem, there exists a unique, increasing, predictable process A t with A 0 = 0 such that M t = N t -A t is a uniformly integrable martingale. We assume that A t is defined as follows,

A t = t 0 λ s ds (5)
with a discrete-time process λ t predictable with respect to the filtration H s as well. As M t is a martingale,

E[M t+dt -M t |H t ] = 0 (6)
Thus,

P(t < τ < t + dt) = E[N t+dt -N t |H t ] = E[ t+dt t λ s |H t ] = λ t dt (7)
So, λ t is called the default intensity and multiplied by dt represents a first order approximation of the probability that the borrower default between t and t + dt.

According to this new definition, the equations of the premium leg 17 and default leg 18 can be defined in function of λ t .

Vasicek Model

The empirical analysis in the article [START_REF] Longstaff | Valuing credit derivatives[END_REF] shows that the logarithm of the credit spread has:

• a significant stability in a narrow range around zero,

• a constant variability.

Moreover, a regression analysis based on a historical data of credit spreads also allows to show a negative slope coefficient. This indicate that the process of diffusion is mean-reverting.

A first theoretical model that has been proposed and that includes meanreversion is the Vasicek model [START_REF] Vasicek | An equilibrium characterization of the term structure[END_REF]. It is a one-factor model i.e., driven by only one source of market risk. With respect to a risk-neutral framework, the dynamics is:

dλ t = γ(θ -λ t )ds + σdW t , γ, θ, σ > 0, λ 0 = λ 0 , (8) where
• θ is the long term mean value of the process,

• γ is the reversion factor that characterizes the speed at which the process tends to θ,

• σ is the volatility of the process,

• W t is a Wiener process under the risk neutral probability,

• λ 0 is the initial condition.

This model is consistent with the historical behaviour of credit spreads because it implies:

• a mean-reverting and homoscedastic diffusion i.e., an homogeneity of the variance,

• credit spreads are positive and conditionally log-normally distributed.

This model has later been used for credit markets by Brigo and Mercurio, (cf. Section 21.1.1 [START_REF] Brigo | Interest Rate Models -Theory and Practice: With Smile, Inflation and Credit[END_REF]).

Cox Ingersoll Ross Model -CIR

Another well-known one factor model is the Cox-Ingersoll-Ross model. It is an extension of the Vasicek model and has been introduced by John C. Cox, Jonathan E. Ingersoll and Stephen A. Ross in 1985 (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF] for theoretical and numerical aspects of CIR processes and the situations where the CIR process has been used in finance). The risk-neutral dynamics is:

dλ t = γ(θ -λ t )dt + σ λ t dW t , γ, θ, σ > 0, λ 0 = λ 0 , (9)
where W t is a Wiener process under the risk neutral framework modelling the random market risk factor. The drift factor, γ(θ -λ t ), is exactly the same as in the Vasicek model. It ensures the mean reversion of the intensity towards the long term mean value θ, with reversion factor γ. The difference lies in the standard deviation factor, σ √ λ t which prevents the possibility of negative value. Moreover, the intensity is strictly positive if the condition 2γθ > σ 2 is met.

Extension -CIR++

There exists an extension of the CIR model which replaces the coefficients by time varying functions in order to make it consistent with the market term structure of the credit spread of the borrower. The most tractable approach is defined in an article of Alfonsi and Brigo [START_REF] Brigo | Credit default swap calibration and derivatives pricing with the SSRD stochastic intensity model[END_REF] where the process follows a CIR process plus a deterministic time-dependent function to be consistent with the term structure. This model is called CIR++ and its risk-neutral dynamics is:

λ t = y t + ψ(t) dy t = γ(θ -y t )dt + σ √ y t dW t , γ, θ, σ > 0, y 0 = y 0 (10)
where W t is a Wiener process under the risk neutral framework modelling the random market risk factor. The deterministic function ψ allows to match the CIR process calibrated on a historical data of credit spread and the market term structure of the credit spreads at a given time t.

CIR model applied to Risky Zero Coupon Bond pricing

Definition and notations

A Zero Coupon (ZC) Bond is a financial product that pays at maturity a unique cash flow equal to the nominal value, here we put the nominal value at 1. Let P (t, T ) be, the bond price at time t with a maturity T . Since the dynamics is risk-neutral, the risk-free ZC bond price is the present value of the cash flow discounted at the risk-free short term interest rate r s ,

B T -t = E[e -T t rsds ] (11)
And the risky ZC bond price is the present value of the cash flow discounted to the risky rate r s + λ s ,

P (t, T ) = E[e -T t (rs+λs)ds ] (12)
where λ s is the default intensity of the borrower.

Assuming the independence between r t and λ t , the risky ZC bond price can be defined as a risk-free ZC bond price times the survival probability from t to T ,

P (t, T ) = B T -t E[e -T t λsds ] = B T -t P CIR (t, T ) (13)

Analytic formula

We assume that λ is defined by the CIR process,

dλ t = γ(θ -λ t )dt + σ λ t dW t , γ, θ, σ > 0, λ 0 = λ 0 (14)
We remind that the CIR process ensure an intensity strictly positive if 2γθ ≥ σ 2 .

Analytic formulas of P CIR (t, T ) are available, see Lando [START_REF] Lando | Credit Risk Modeling[END_REF] page 292. The intensity is following a CIR dynamic so the characteristic function of the χ 2 distribution allows to give for general t, T :

P CIR (t, T ) = α(t, T )e -β(t,T )λ , (15)
where,

         α(t, T ) = 2h e (γ+h) T -t 2 2h+(γ+h)(e (T -t)h -1) 2γθ σ 2 β(t, T ) = 2(e (T -t)h -1) 2h+(γ+h)(e (T -t)h -1) , h = γ 2 + 2σ 2 . ( 16
)
where γ and σ are the parameters of the CIR process of the intensity in Equation ( 14).

CIR model calibration

The calibration of the coefficients γ, θ and σ can be based on bond prices or on CDS spreads. A bond is a funded asset, we thus prefer to use a historical data of CDS spread to avoid the bias of the funding cost. Indeed, the CDS is a pure credit instrument assuming it is liquid enough and its market is not in a disturbing cycle.

Credit derivative market

Definitions and notions

Credit derivatives are over-the-counter (OTC) financial instruments that enable financial institutions, corporate and institutional investors to protect themselves against credit risk or to express a view on a particular credit risk by way of bilateral agreements.

In the credit derivative market, the most widely used instrument is the Credit Default Swap (CDS) contract. A CDS is a bilateral OTC agreement, which transfers a defined credit risk from the protection buyer to the protection seller:

• the buyer pays a periodic and fixed premium (usually on a quarterly basis) to the seller in return for protection against a credit event of a reference entity. The protection buyer stops paying the regular premium in case of a credit event.

• the seller makes a payment to the buyer if a credit event occurs. Typically this payment takes the form of a physical exchange of the asset between the buyer and the seller. The net loss to the seller is therefore par less the recovery value on the delivered obligation. If no credit event occurs during the life of the swap, these premium payments are the only cash flows.

It is important to notice that there is no exchange of underlying principal, alike the other financial swaps.

The Figure 4.1.1 describes physical settlement or cash settlement. Even if single-name CDSs are often physically settled, CDS indices and tranches are cash settled to simplify the recovery process in case of credit event. In such cases, the protection seller would provide a single cash payment reflecting the mark-to-market loss of the underlying debt obligation of the reference entity. The settlement value for index and tranche defaults is determined via auctions in the 90 days following the default.

CDS contracts can refer to single credits (bond or loan) or portfolios, such as indices or synthetic Collateralized Debt Obligations (CDOs) and usually have a term between one and ten years. The most liquid maturity term for CDS contracts is 5 years. Contracts are documented under International Swap and Derivatives Association Inc. (ISDA) swap documentation and the 2003 ISDA Credit Derivative Definitions as amended by various supplements.

Even if CDSs are OTC instruments, the majority of transactions in the market are quite standardized. CDS contracts typically have coupons on a quarterly basis, at the following dates: 20th March, 20th June, 20th September and 20th December. That is why these dates are often used as maturity date for the contracts. This standardization increases the liquidity of CDS contracts and it allows the clearing of the CDS position. The clearing involved a third party, a clearing house, which purpose is to reduce the settlement risk between buyer and seller by matching buy and sell orders of a same reference entity on the market.

In the economy, banks have regulatory and economic capital constraints to reduce and manage their credit exposures and to take positive or negative credit positions.

Credit derivatives enable users to:

• hedge or mitigate credit exposure,

• manage and transfer credit risk,

• generate leverage or yield enhancement,

• decompose and separate risks embedded in securities (such as in convertible bond arbitrage),

• manage regulatory capital ratios.

Credit derivatives are much more flexible and have a wider range of application than traditional credit instruments (loans or bonds). One of the most important structural characteristic of credit derivatives is that they separate credit risk from funding: a seller can invest in the debt of a reference entity without paying a nominal amount (or fair value) as the purchase of a bond or a loan in the primary or secondary markets.

The largest participants in the market are banks, insurance companies and hedge funds. Banks are the major buyers due to their protection needs on their credit portfolio.

Default probability model

This model calculates the implied default probability of the reference entity from the discounted cash flows in the credit default swap. In the CDS market, the unsecured recovery rate of a senior debt is assumed at 40%. A time-series Figure 6: We illustrate here the cash flows of a default swap with a premium of c paid on a quarterly basis and a fixed recovery R.

of survival probabilities is assessed by a bootstrap method from the term structure of the CDS spread.

A CDS consists of two legs:

• The fixed leg or premium leg represents the fixed premium transferred from the protection buyer to the protection seller until the earlier of a credit event or maturity of the contract.

• The floating leg or default leg represents the difference between the notional amount and the recovery amount of the underlying debt transferred from the protection seller to the protection buyer if a credit event occur during the contract.

These cash flows are shown in Figure 4.1.2 for a CDS contract with a fixed premium c paid, for example on a quarterly basis, and a recovery R. The occurrence of the future cash flows will depend on the survival probability of the reference entity.

The premium leg is the sum of the n payment of the premium c made by the protection buyer on a quarterly basis at time t i , i = {0, .., n}, discounted by the risk-free and by the survival probabilities (τ is the stopping time representing the instant of default):

P L 0 = n i=1 E c 4 B t i 1 {τ t i } + c(τ -t i-1 )B τ 1 {t i-1 <τ <t i } (17)
The default leg is the loss, i.e. the difference between the nominal amount and the recovery value, discounted by the risk-free and by the default probability.

DL 0 = (1 -R)E B τ 1 {τ <tn} (18)
Under no arbitrage constraint, the present value of the fixed leg is equal the present value of the floating leg at the inception of the contract, [START_REF] Cerny | Mathematical Techniques in Finance: Tools for Incomplete Markets[END_REF] we can solve for the premium:

n i=1 E c 4 B t i 1 {τ t i } + c(τ -t i-1 )B τ 1 {t i-1 <τ <t i } = (1 -R)E B τ 1 {τ <tn}
c = (1 -R)E B τ 1 {τ <tn} n i=1 E 1 4 B t i 1 {τ t i } + (τ -t i-1 )B τ 1 {t i-1 <τ <t i } (20)

Maximum Likelihood Estimation (MLE)

The most familiar method to provide estimates for the model's parameters is the maximum likelihood estimation. We chose to use historical data of the 1Y CDS spreads. Unfortunately, there doesn't exist an instantaneous CDS spread so we have to assume the intensity λ [0-1] is constant during the first year. Assuming a 1Y CDS pays only one coupon S 1Y per year at maturity, the loss 1 -R in case of default is also paid at maturity and r is constant, we can approximate the CDS pricing formula 19 as follows,

S 1Y e -λ [0-1] e -r = (1 -R)(1 -e -λ [0-1] )e -r (21)
Thus we obtain a historical intensity λ [0-1] form the CDS spread S 1Y ,

λ [0-1] = log( S 1Y + 1 -R 1 -R ) (22)
We define the n + 1 observations at discrete time points λ 0 ,λ δ ,λ 2δ ,...,λ nδ . Here δ is the sampling interval and can be either fixed or very small corresponding to high-frequency data.

According to the parameters of the CIR process defined in the Equation 14, let c = 4γσ -2 (1 -e -γδ ) -1 , the transitional distribution of cλ t given λ t-1 is non-central χ 2 κ (ν) with the degree of freedom κ = 4γθσ -2 and the non-central component ν = cλ t-1 e -γδ . The conditional mean and variance of λ t given λ t-1 are

E(λ t |λ t-1 ) = λ t-1 e -γδ + θ(1 -e -γδ ) (23)
V ar(λ

t |λ t-1 ) = 1 2 θσ 2 γ -1 (1 -e -γδ ) 2 + λ t-1 σ 2 γ -1 (e -γδ -e -2γδ ) (24)
Unfortunately, there doesn't exist explicit formulas of the MLEs for our parameters because the non-central χ 2 -density function is an infinite series involving central χ 2 densities. But we can consider pseudo-likelihood estimators, see Nowman [START_REF] Nowman | Gaussian estimation of single-factor continuous time models of the term structure of interest rates[END_REF], which give close form formulas of the parameters from an approximation of the CIR process obtained by a Bergstrom method.

We obtain the following pseudo-MLEs (with and without a bias),

γwith bias = - log( α1 ) δ , (25)
γ = γwith bias -4 + 2

2γ with bias α2 σ2

with bias

-1 (nδ) -1 , (26)
θ = α2 , (27)
σ2 with bias = 2γ with bias α3 1 -α2 , (28)
σ2 = σ2 with bias -σ2 with bias (1 -e -γ with bias δ ) 2( 2γ with bias α2 σ2 with bias -1) .

where,

α1 = n -2 n i=1 λ iδ n i=1 λ -1 (i-1)δ -n -1 n i=1 λ iδ λ (i-1)δ n -2 n i=1 λ iδ n i=1 λ -1 (i-1)δ -1 (30) α2 = n -1 n i=1 λ iδ λ -1 (i-1)δ -α1 (1 -α1 )n -1 n i=1 λ -1 (i-1)δ (31) α3 = n -1 n i=1 {λ iδ -λ (i-1)δ α1 -α2 (1 -α1 )} (32)

Term structure calibration

As it is difficult to provide relevant coefficients in a disturbing market, we decided to propose another method based on a direct calibration of the term structure. It means that the parameters minimize the errors between the market default probability F (t) and the CIR model default probability 1 -P CIR (0, t).

Let F (t) be the market cumulative distribution function of τ ,

F (t) = P(τ < t) (33)
Assuming the market default intensity is deterministic and even a piecewise constant function λ market (t). The F (t) function is obtained by an iterative bootstrapping method of the CDS curve. In the credit market, we denote q maturities of CDS T i : T 1 = 1 year, T 2 = 2 years, T 3 = 3 years, T 4 = 5 years, T 5 = 7 years and T 6 = 10 years. So the function λ market (t) is a piecewise constant function defined by six constant values:

λ [0-1] , λ [1-2] , λ [2-3] , λ [3-5]
, λ [START_REF] Abramowitz | Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables[END_REF][START_REF] Achdou | Computational Methods for Option Pricing[END_REF][START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF] and λ [START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Henry | The crisis in russia: Some initial observations[END_REF][START_REF] Barles | The dirichlet problem for semilinear secondorder degenerate elliptic equations and applications to stochastic exit time control problems[END_REF] .

The algorithm is as follows:

1. We start at T = 1, the market CDS spread S 1Y is known, so by inverting the simplified CDS pricing formula,

S 1Y = (1 -R)β 1 (1 -e -λ [0-1] ) β 1 e -λ [0-1] (34)
We obtain λ

[0-1] , λ [0-1] = log( S 1Y + 1 -R 1 -R ) (35)
2. We continue with T = 2, the market CDS spread S 2Y is known, so by inverting the simplified CDS pricing formula,

S 2Y = (1 -R)[β 1 (1 -e -λ [0-1] ) + β 2 (e -λ [0-1] -e -λ [0-1] -λ [1-2] )] β 1 e -λ [0-1] + β 2 e -λ [0-1] -λ [1-2] (36)
We obtain λ

[1-2] , λ [1-2] = ... (37)
3. We repeat this process until λ [START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Henry | The crisis in russia: Some initial observations[END_REF][START_REF] Barles | The dirichlet problem for semilinear secondorder degenerate elliptic equations and applications to stochastic exit time control problems[END_REF] .

At the end, when each values λ

[0-1] , λ [1-2] , λ [2-3] , λ [3-5]
, λ [START_REF] Abramowitz | Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables[END_REF][START_REF] Achdou | Computational Methods for Option Pricing[END_REF][START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF] and λ [START_REF] Adam | Handbook of Asset and Liability Management: From Models to Optimal Return Strategies[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Henry | The crisis in russia: Some initial observations[END_REF][START_REF] Barles | The dirichlet problem for semilinear secondorder degenerate elliptic equations and applications to stochastic exit time control problems[END_REF] are known, we can define the market cumulative distribution function F (t), ∀t ∈ [0, 10],

F (t) = 1 -e -q i=1 λ market (t)(T i -T i-1 )1 {T i <t} -q i=1 λ market (t)(t-T i-1 )1 {T i-1 <t T i } (38)
Remark 1 For the CIR++ extension, there exists a closed formula of the shift function ψ(t), see Brigo and Mercurio [START_REF] Brigo | Interest Rate Models -Theory and Practice: With Smile, Inflation and Credit[END_REF], depending on the market term structure of the CDS spread.By bootstrapping the CDS curve, we obtain F (t), so we look for ψ(t) such,

P(τ > t) = E[e -t 0 ψ(s)ds-t 0 λsds ] = 1 -F (t) (39)
Thus,

t 0 ψ(s)ds = log P CIR (0, t) 1 -F (t) (40)
Thus the shift term is,

ψ(t) = f market (0, t) -f CIR (0, t) (41)
where,

f market (0, t) = - ∂log(1 -F (t)) ∂t (42)
f CIR (0, t) = - ∂log(P CIR (t)) ∂t (43)
By Lebesgue derivation, we obtain,

f market (0, t) = q 1 λ market (t)1 {T j-1 t T j } (44)
And Brigo and Mercurio [START_REF] Brigo | Interest Rate Models -Theory and Practice: With Smile, Inflation and Credit[END_REF] provide,

f CIR (0, t) = 2γθ(e ht -1) 2h + (γ + h)(e ht -1) + λ 0 4h 2 e ht (2h + (γ + h)(e ht -1)) 2 (45)
where h = γ 2 + 2σ 2 .

Remark 2 We still have some doubt about the CDS as best indicators. Indeed since 2008, the markets of the CDS are particularly stressed and the implicit probability of default of the CDS does not reflect the probability of default specified by the ratings of the rating agencies or ratings of a bank. These ratings are used by the banks in the calculation of their reserves and their requirements in Tier 1 common capital. They are thus used to define the commercial margins. This asymmetry of credit risk is problematic because it creates an asymmetry of price between the price based on an rating model and a market model. On the other hand, the credit risk implied by the CDS allows removing the volatility of the Mark-to-market in Hedge Accounting because the hedging instrument and the underlying asset are defined on the same indicator of credit risk. The credit risk can also be evaluated from bond or EDF (indicator of default of Moody's).

Liquidity cost

To finish, we introduce the notion of the liquidity in terms of funding cost and regulatory constraint. We propose a regime switching approach to simulate the diffusion process of the liquidity cots.

Liquidity risk

It is interesting to carry out a study on the long-term funding costs of various banks, like BNP Paribas, based on their bond programs. A study of utilization amounts of the credit lines and deposits has been made to prevent liquidity risk on the commitments of BNP Paribas with its corporate customers. However it will not be presented in this thesis for reasons of confidentiality. The pricing will then primarily concern Term loans i.e., 100% utilized. Moreover we will assume that the liquidity cost specific to the loans is equal to the funding cost of the bank on the bond market. For a financial institution, the liquidity risk represents the risk that it doesn't have enough liquidity to respect its commitments towards its customers. This risk is strongly linked to the reputational risk of the bank. There exist three categories of liquidity risk. The structural liquidity risk is due to an asymmetry in the structure of the balance sheet of the bank at some point according to modifications in the schedule of the repayments on individual positions, resulting from contractual flows or unexpected flows of the treasury. We will not be interested in this category of risk which is an exclusive topic of the Asset Liability Management (ALM). Moreover, it is necessary to have access to the balance sheet of the bank in minute detail. The contingent liquidity risk is due to an unexpected request for short-term liquidity eg., utilization of the lines of commitment by lenders, withdrawals of the deposits... This risk has been the object of a study on the rates of utilization of the lines of commitment and a study on the stability of the deposits. The statistical behaviour of the corporate customers of the bank showed that the utilization rate and withdrawals of the deposits were strongly correlated with the economic environment. The customers of the bank tend to use their credit lines and liquidity lines when the other funding sources become too expensive, eg. issue of bonds. Studies highlighted the correlation between the volume of bond issuances and the volume of loans. We also observed an outflow of deposits in time of liquidity crisis. The market liquidity risk is due to a reduction in the confidence of the investors, then causing difficulties accessing to the funding on the market and difficulties selling assets at their fair value. To avoid the common amalgam between these two market risks, we will define the second as a liquidation risk. A study of the impact of the market on the long-term funding costs was made on the levels of funding of the main banks based on their bond issuances. We thus studied the history of the levels of the discount margin of floating rate notes and the asset-swap spread of fixed rate bond according to various maturities and various currencies. The year 2011 is an example of very explicit crisis of liquidity. Indeed the crisis of the European sovereign national debt has caused a crisis of confidence within the investors. The systemic risk inherent to the banks and their strong exposures to this kind of debt created a rise in the funding costs, see hereunder the evolution of the margin on the secondary bond market. Before the beginning of the crisis of the sovereigns in August 2011, the funding costs of BNP Paribas in Euro were very stable. Indeed, the volatility was very low during the 1st semester. On the 2nd semester, the costs have sharply increased. There were three jumps of strong amplitude in August, September and November. Moreover, it is interesting to notice that the fall initiated at the beginning of the year 2012 is definitely more progressive, this can be justified by a much slower return of the confidence of the investors. The finding is the same for the evolution of the funding costs in US dollar These first results underline the significance of the liquidity cost to assess the price of the loans with a refinancing risk related to the prepayment.

Basel III: Liquidity ratios

The Basel Committee on Banking Supervision (BCBS) in Basel, Switzerland, has published a set of guidelines since 1988 with three main updates in response to the financial evolution and crises, see Figure 5.2.

• Basel I is the 1988 Basel Accord and it is primarily focused on credit risk,

• Basel II was published in June 2004 to create an international standard for banking regulators to control the level of regulatory capital of banks to hedge the financial risks and the operational risks.

• Basel III is the latest update and aims at addressing the lessons of the 2007 crisis. To prevent future crises, 5 key actions are considered:

a better quality, more consistency and transparency of the capital base, to promote a very simple leverage ratio based on gross exposures, to reduce procyclicality and promote capital buffers by implementing a dynamic provisioning based on expected loss (EL).

Among the banking sector, each bank's situation is different from the other, all major European banks have adopted Basel 2 rules but American banks are still under Basel 1 rules.

This part focuses mainly on the new liquidity ratios (cf. the Basel's publication [START_REF]Basel iii: International framework for liquidity risk measurement, standards and monitoring[END_REF]). During the financial crisis, many banks struggle to maintain adequate liquidity so the key strength for a global Corporate and Investment Banking (CIB) bank is now to have a better understanding of these new regulatory ratios. In the liquidity aspect, the main objective of the regulators is to require more and longer term funding from banks with the implementation of an international and uniform quantitative framework to measure and monitor liquidity risk.

Two measures of liquidity considered as new minimum requirements have been developed to achieve complementary objectives on short-term and longterm funding needs:

• Liquidity Coverage Ratio: to ensure sufficient high quality and liquid resources to survive a 1-month stress scenario,

• Net Stable Funding Ratio: promote longer term stability, capture funding instabilities over a 1-year period.

Liquidity Coverage Ratio (LCR)

The LCR is a stress-test ratio to assess the basic ability to survive of a bank within a 1-month horizon if trades with other banks are frozen and depositors start withdrawing their funds. It means the expected net cash outflows have to be fully covered by high quality liquid assets. For the assets with a lower quality, a haircut is applied by the regulators, i.e. the value of the asset is reduced by a certain percentage.

LCR =

High Quality Liquid Assets Net Cash Outflows over 1 month 100%

High Quality Liquid Assets are defined by the regulators as follows:

• AAA-securities (supranationals, sovereign/government bonds under strict conditions),

• A-or above corporate and covered bonds with a haircut from 20%-to-40%.

Net Cash Outflows are defined as follows:

• deposits with maturity or call option of less than 1-month with a run-off factor,

• Other liability cashflows with expected drawings on off-balance sheet items,

• Other asset cashflows with potential drawings on contingent liabilities.

The implementation deadline of the LCR is the 1st January 2015.

Net Stable Funding Ratio (NSFR)

The NSFR allows to curb the reliance to short-term interbank funding on middle and long-term commitments. It aims at ensuring that available stable funding fully covers required stable funding needs over a 1-year horizon.

N SF R = Available Stable Funding Required Stable Funding 100% (47)
Available Stable Funding is defined by the regulators as follows:

• medium-term and long-term liabilities (public, private and term deposits),

• short-term resources considered as stable with a haircut from 10%-to-50%.

Required Stable Funding is defined as follows:

• stable assets with residual maturity above one year,

• liquidity unencumbered assets with residual maturity above one year with a haircut from 35%-to-95%..

• short-term assets considered as stable with a haircut from 15%-to-50%,

• credit line and liquidity lines not used with a 95% haircut.

The implementation deadline of the NSFR is the 1st January 2018, but it is still in discussion.

Consequences for the banks

The first consequence will be a rise in the funding costs. Indeed, shortterm assets are expected to get rolled over to fund medium-term or longterm. Moreover a narrow definition of highly liquid assets does not allow easy building of a large liquidity buffer book.

On the other hand, the reliability to "standard monetary cycle" is denied: assets' eligibility to central banks monetary programs is only a "nice to have". Relationship with imperfect correlation across all financial institutions are denied, even within a same group (from financial captive arm of corporate groups to long-only investors) and the consistency with other regulation, as Solvency, II is questionable.

To conclude, the liquidity ratios embrace a hedging philosophy already existing in most jurisdictions, but they cover assumptions which are harsher than previously experienced during the crisis and sometimes unrealistic: eg. clients draw on their lines and withdraw their deposits at the same time.

Regime switching models

The liquidity cost invoiced to the lender is defined as the specific cost of a bank to access the cash on the market and it is assumed equivalent to the funding cost of the bank. Following the study made on the funding costs, we could notice variations in the form of jumps and irregular volatilities. It was thus difficult to model the liquidity cost with a model such as Markovian models Heath-Jarrow-Morton (HJM) (cf. Chapter 5 [START_REF] Brigo | Interest Rate Models -Theory and Practice: With Smile, Inflation and Credit[END_REF]). On the contrary, a multi-regime approach seems particularly appropriate to the liquidity costs. According to the state of the economic environment, the liquidity cost can be defined by various trends. Between two crises, the banks are trusted by the investors and have access easily to the liquidity on the market through programs of long-term bonds. However, when a crisis occurs, the liquidity is rare and it creates an abrupt and sudden rise of the liquidity costs. It will then be necessary to expect the progressive return of the confidence of the investors to observe a reduction in the costs. To model these distinct behaviours, we model the liquidity costs by a Markov chain with a finite set of possible values, one for each liquidity regime. Therefore, the assessment of the loan value and the prepayment option can be written as a system of coupled partial differential equations, one for each liquidity regime.

The economic state of the market is described by the Markov chain X = {X t , t ≥ 0}. X takes values in a finite set of unit vectors E = {e 1 , e 2 , ..., e N }. We can suppose, without loss of generality, that e i = (0, ..., 0, 1, 0, ..., 0) T ∈ R N . Here T is the transposition operator. Assuming the process X t is homogeneous in time and has a rate matrix A,

then if p t = E[X t ] ∈ R N , dp t dt = Ap t (48)
Denote by a k,j the entry on the line k and the column j of the N × N matrix A with a k,j ≥ 0 for j = k and N j=1 a k,j = 0 for any k. We define the process X t as follows,

X t = X 0 + t 0 AX u du + M t , (49)
where M = {M t , t ≥ 0} is a martingale with respect to the filtration generated by X. In differential form

dX t = AX t dt + dM t , X 0 = X 0 . ( 50
)
We assume that the instantaneous liquidity cost of the bank depends on the state X of the economy, so that

l t = l, X t (51)
We choose here a simple model with no diffusion process. Our purpose is to illustrate the systemic risk on liquidity. It is possible to use a CIR process with coefficients γ, θ, σ depending on the regime X but in this case, there is no analytic formula for ξ and we need to compute it from its PDE. The default intensity λ t is defined by a Cox-Ingersoll-Ross process, cf. Section3.3, with parameters depending on the regime X t :

dλ t = γ λ (X t )(θ λ (X t ) -λ t )dt + σ λ (X t ) λ t dW t , λ 0 = λ 0 , (52) γ λ (X t ), θ λ (X t ), σ λ (X t ) > 0. ( 53
)

Term-structure of the liquidity cost

In each regime l k , k = 1, .., N , we can build a term-structure of the liquidity cost that refers to the cost at different tenors. In the more stressful regime, the curve will be inverted. It is the rarest type of curve and indicates an economic recession (see Figure 30). The liquidity cost L k t,T for a contractual maturity T at time t is defined by the following equality:

e -L k t,T (T -t) = E e -T t ludu X t =< X, e k > . (54)
Therefore, We illustrate here the term-structure of the liquidity cost in bps in 3 several regimes : recession (dashed), stable(solid) and expansion(dotted).

L k t,T = - ln (f k (T -t)) T -t (55)
L 0,T = -1 T ln (f k (T ))
Part II

Perpetual corporate loans: One-Dimension space model

Abstract This part presents an work that has been published in the journal: Abstract and Applied Analysis [START_REF]Valuation of the prepayment option of a perpetual corporate loan[END_REF]. We investigate in this paper a perpetual prepayment option related to a corporate loan. The valuation problem has been modelled as an American call option on a risky debt owned by the borrower. The default intensity of the firm is supposed to follow a CIR process. We assume the contractual margin of a loan is defined by the credit quality of the borrower and the liquidity cost that reflects the funding cost of the bank. Two frameworks are discussed: firstly a loan margin without liquidity cost and secondly a multi-regime framework with a liquidity cost dependent on the regime. The prepayment option needs specific attention as the payoff itself is an implicit function of the parameters of the problem and of the dynamics. In the unique regime case, we establish quasi analytic formulas for the payoff of the option; in both cases we give a verification result that allows to compute the price of the option. Numerical results that implement the findings are also presented and are completely consistent with the theory; it is seen that when liquidity parameters are very different (i.e., when a liquidity crisis occur) in the high liquidity cost regime the exercise domain may entirely disappear, meaning that it is not optimal for the borrower to prepay during such a liquidity crisis. The method allows to quantify and interpret these findings.

6 Introduction

When a firm needs money it can turn to its bank which lends it against e.g., periodic payments in a form of a loan. In almost every loan contract, the borrower has the option to prepay a portion or all the nominal at any time without penalties. Even if the technicalities are, as it will be seen in the following, different, the concept of this option is very close to the embedded option of a callable bond. When its credit spread has gone down, the issuer of the bond can buy back his debt at a defined call price before the bond reaches its maturity date. It allows the issuer to refinance its debt at a cheaper rate.

The interest rate of a loan is the sum of a constant interest rate (eg. LIBOR or EURIBOR) and a margin defined according to the credit quality of the borrower and a liquidity cost that reflects the funding costs of the lender, the bank. We assume in this model that the interest rate is constant and known. The liquidity cost dynamics will be described later.

In order to decide whether the exercise of the option is worthwhile the borrower compares the remaining payments (actualized by the interest rate he can obtain at that time) with the nominal value. If the remaining payments exceed the nominal value then it is optimal for the borrower to refinance his debt at a lower rate.

When the interest rates are not constant or the borrower is subject to default, the computation of the actualization is less straightforward. It starts with considering all possible scenarios of evolution for interest rate and default intensity in a risk-neutral framework and compute the average value of the remaining payments (including the final payment of the principal if applicable); this quantity will be called "P V RP "(denoted ξ) and is the present value of the remaining payments i.e., the cash amount equivalent, both for borrower and lender in this model of the set of remaining payments. The P V RP is compared with the nominal : if the P V RP value is larger than the nominal then the borrower should prepay, otherwise not. Recall that at the initial time the payments correspond to a rate, the sum of the interest rate and a contractual margin ρ 0 , which is precisely making the two quantities equal. Note that in order to compute the price of the embedded prepayment option the lender also uses the P V RP as it will be seen below.

For a bank, the prepayment option is essentially a reinvestment risk i.e., the risk that the borrower decides to repay earlier his/her loan and that the bank can not reinvest its excess of cash in a new loan. So the longer the maturity of the loan, the riskier the prepayment option. Therefore, it is interesting to study long-term loans that are set for more than three years and can run for more than twenty years. The valuation problem of the prepayment option can be modelled as an American embedded option on a risky debt owned by the borrower. As Monte-Carlo simulations are slow to converge to assess accurately the continuation value of the option during the life of the loan and that the binomial tree techniques are time-consuming for long-term loans (cf. works by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]), we decided to focus, in this paper, on the prepayment option for perpetual loan.

When valuing financial products with long maturity, the robustness with respect to shocks and other exogenous variabilities is important. Among problems that have to be treated is the liquidity and its variability. Liquidity is the key of the stability of the entire financial system and can cause banks' failures if systemic liquidity squeezes appear in the financial industry. Historical events like the Asian crisis of 1997 [START_REF] Wc | The Asian Financial Crisis: Origins, Implications and Solutions[END_REF]; the Russian financial crisis of 1998 [START_REF] Henry | The crisis in russia: Some initial observations[END_REF]; the defaults of hedge funds and investment firms like LTCM, Enron, Worldcom and Lehman Brothers defaults, sovereign debts crisis of 2010-11 and so on prove that banks hold significant liquidity risk in their balance sheets. Even if liquidity problems have a very low probability to occur, a liquidity crisis can have a severe impact on a bank's funding costs, its market access (reputation risk) and short-term funding capabilities.

Following the state of the economic environment, the liquidity can be defined by distinct states. Between two crises, investors are confident and banks find it easier to launch their long term refinancing programs through regular bonds issuances. Thus the liquidity market is stable. Unfortunately, during crisis, liquidity become scarce, pushing the liquidity curve to very high levels which can only decrease if confidence returns to the market. The transition between these two distinct behaviours is rarely smooth but rather sudden.

In order to model the presence of distinct liquidity behaviours we will simulate the liquidity cost by a continuous time Markov chain that can have a discrete set of possible values, one for each regime that is encountered in the liquidity evolution.

From a technical point of view this paper faces several non-standard conditions: although the goal is to value a perpetual American option the payoff of the option is highly non-standard (is dependent on the P V RP ). As a consequence, the characterization of the exercise region is not standard and technical conditions have to be met. Furthermore, our focus here is on a specific type of dynamics (of CIR type) with even more specific interest on the situation when several regimes are present.

The balance of the paper is as follows: in the remainder of this section (Sub-Section 6.1) we review the related existing literature; in Section 7, we consider that the liquidity cost is negligible and that the borrower credit risk is defined by his/her default intensity (called in the following simply "intensity") which follows a CIR stochastic process. In this situation, we are able to obtain a quasi-analytic formula for the prepayment option price. In Section 8 we explore the situation when the liquidity cost, defined as the cost of the lender to access the cash on the market, has several distinct regimes that we model by a Markov chain. We write the pricing formulas and theoretically support an algorithm to identify the boundary of the exercise region; final numerical examples close the paper.

Related literature

There exist few articles (e.g., works by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]) on the loan prepayment option but a close subject, the prepayment option in a fixed-rate mortgage loan, has been widely covered in several papers by J.E. Hilliard and J.B. Kau [START_REF] Hillard | Valuing prepayment and default in a fixed-rate mortgage: A bivariate binomial options pricing technique[END_REF] and more recent works by Chen et al. [START_REF] Chen | The value of mortgage prepayment and default options[END_REF]. To approximate the PDE satisfied by the prepayment option, they define two state variables (interest rate and house price). Their approach is based on a bivariate binomial option pricing technique with a stochastic interest rate and a stochastic house value.

Another contribution by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF] applies the binomial tree technique (but of course it is time-consuming for long-term loans due to the nature of binomial trees) to corporate loans. They consider a prepayment option with a 1 year loan with a quarterly step but it is difficult to have an accurate assessment of the option price for a 10 years loan.

There also exist mortgage prepayment decision models based on Poisson regression approach for mortgage loans. See, for example, E.S. Schwartz and W.N. Torous [START_REF] Schwartz | Mortgage prepayment and default decisions: A Poisson regression approach[END_REF]. Unfortunately, the volume and history of data are very weak in the corporate loan market.

Due to the form of their approach, these papers did not have to consider the geometry of the exercise region because it is explicitly given by the numerical algorithm. This is not the case for us and requires that particular care be taken when stating the optimality of the solution. Furthermore, to the best of our knowledge, none of these approaches explored the circumstance when several regimes exist.

The analysis of Markov-modulated regimes has been investigated in the literature when the underlying(s) follow the Black& Scholes dynamics with drift and volatility having Markov jumps; several works are of interest in this area: Guo and Zhang [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] have derived the closed-form solutions for vanilla American put; Guo analyses in [START_REF] Guo | An explicit solution to an optimal stopping problem with regime switching[END_REF] Russian (i.e., perpetual look-back) options and is able to derive explicit solutions for the optimal stopping time; in [START_REF] Xu | Perpetual American maximum options with Markov-modulated dynamics[END_REF] Y. Xu and Y. Wu analyse the situation of a two-asset perpetual American option where the payoff function is a homogeneous function of degree one; Mamon and Rodrigo [START_REF] Mamon | Explicit solutions to European options in a regime-switching economy[END_REF] find explicit solutions to vanilla European options. Buffington and Elliott [START_REF] Buffington | American options with regime switching[END_REF] study European and American options and obtain equations for the price. A distinct approach (Hopf factorization) is used by Jobert and Rogers [START_REF] Jobert | Option pricing with Markov-modulated dynamics[END_REF] to derive very good approximations of the option prices for, among others, American puts. Other contributions include [START_REF] Yao | A regime-switching model for European options[END_REF][START_REF] Tak | Pricing currency options under two-factor Markov-modulated stochastic volatility models[END_REF], etc.

Works involving Markov switched regimes and CIR dynamics appears in [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] where the bond valuation problem is considered (but not in the form of an American option; their approach will be relevant to the computation of the payoff of our American option although in their model only the mean reverting level is subject to Markov jumps) and in [START_REF] Zhou | An accessible implementation of interest rate models with markov-switching[END_REF] where the term structure of the interest rates is analysed.

On the other hand numerical methods are proposed in [START_REF] Huang | Methods for pricing American options under regime switching[END_REF] where it is found that a fixed point policy iteration coupled with a direct control formulation seems to perform best.

Finally, we refer to [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF] for theoretical results concerning the pricing of American options in general.

Perpetual prepayment option with a stochastic intensity CIR model

We assume throughout the paper that the interest rate r is constant. Therefore, the price of the prepayment option only depends on the intensity evolution over time. We model the intensity dynamics by a Cox-Ingersoll-Ross process (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF] for theoretical and numerical aspects of CIR processes and the situations where the CIR process has been used in finance):

dλ s = γ(θ -λ s )ds + σ λ s dW s , γ, θ, σ > 0, λ 0 = λ 0 (56)
It is known that if 2γθ ≥ σ 2 then CIR process ensures an intensity strictly positive. Fortunately, as it will be seen in the following, the PVRP is given by an analytic formula.

Analytical formulas for the PVRP

Assume a loan with a fixed coupon defined by the interest rate r and an initial contractual margin ρ 0 . Here ρ 0 don't take into account any commercial margin, see Remark [START_REF] Chesney | Analytical solutions for the pricing of American bond and yield options[END_REF]. Let ξ(t, T, λ) be, the present value of the remaining payments at time t of a corporate loan with initial contractual margin ρ 0 (depending on λ 0 ), intensity at time t, λ t , following the risk-neutral equation [START_REF] Yao | A regime-switching model for European options[END_REF] with λ t = λ, has nominal amount K and contractual maturity T . Here the assignment λ t = λ means that the dynamic of λ t starts at time t from the numerical value λ. All random variables will be conditional by this event, see eg. Equation [START_REF] Zhou | An accessible implementation of interest rate models with markov-switching[END_REF].

Therefore the loan value LV (t, T, λ) is equal to the present value of the remaining payments ξ(t, T, λ) minus the prepayment option value P (t, T, λ).

LV (t, T, λ) = ξ(t, T, λ) -P (t, T, λ) (57)
The present value of the cash flows discounted at the (instantaneous) risky rate r + λ t , is denoted by ξ. The infinitesimal cash flow at time t is K(r + ρ 0 ) and the final payment of the principal K. Then:

ξ(t, T, λ) = E K • (r + ρ 0 ) T t e -t t (r+λu)du d t + Ke -T t r+λudu λ t = λ (58)
For a perpetual loan the maturity T = +∞. Since λ t is always positive r + λ t > 0 and thus the last term tend to zero when T → ∞. A second remark is that since γ, θ and σ independent of time, ξ is independent of the starting time t :

ξ(t, λ) = E K • (r + ρ 0 ) +∞ t e -t t r+λudu d t λ t = λ (59) = E K • (r + ρ 0 ) +∞ 0 e -t 0 r+λudu d t λ 0 = λ =: ξ(λ), (60)
where the last equality is a definition. For a CIR stochastic process, we obtain (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF]),

ξ(λ) = K • (r + ρ 0 ) +∞ 0 e -r tB(0, t, λ)d t (61)
where for general t, t we use the notation:

B(t, t, λ) = E e -t t λudu λ t = λ . (62)
Note that B(t, t, λ) is a familiar quantity and analytic formulas are available for Equation 62, see Lando [START_REF] Lando | Credit Risk Modeling[END_REF] page 292. The intensity is following a CIR dynamic therefore, for general t, t:

B(t, t, λ) = α(t, t)e -β(t, t)λ , (63)
with,

α(t, t) = 2h e (γ+h) t-t 2 2h + (γ + h)(e ( t-t)h -1) 2γθ σ 2 β(t, t) = 2(e ( t-t)h -1) 2h + (γ + h)(e ( t-t)h -1)
,

where h = γ 2 + 2σ 2 . ( 64
)
where γ and σ are the parameters of the CIR process of the intensity in Equation [START_REF] Yao | A regime-switching model for European options[END_REF]. Obviously B(0, t, λ) is monotonic with respect to λ, thus the same holds for ξ.

The margin ρ 0 is the solution of the following equilibrium equation:

ξ(λ 0 ) = K (65)
which can be interpreted as the fact that the present value of the cash flows (according to the probability of survival) is equal to the nominal K:

ρ 0 = 1 +∞ 0 e -r tB(0, t, λ 0 )d t -r. (66)
Note that we assume no additional commercial margin.

Remark 3 If an additional commercial margin µ 0 is considered then ρ 0 is first computed as above and then replaced by ρ 0 = ρ 0 + µ 0 in Equation (61). Equations (65) and (66) will not be verified as such but will still hold with some λ 0 instead of λ 0 ; for instance we will have

ρ 0 = 1 +∞ 0 e -r tB(0, t, λ 0 )d t -r. ( 67
)
With these changes all results in the paper are valid, except that when computing for operational purposes once the price of the prepayment option is computed for all λ one will use λ = λ 0 as price relevant to practice.

Remark 4 Some banks allow (per year) a certain percentage of the prepaid amount without penalty and the rest with a penalty. This circumstance could be incorporated into the model by changing the definition of the payoff by subtracting the penalty. This will impact the formula 69.

From definition (62) of B(t, t, λ) it follows that B(t, t, λ) < 1 thus e -r tB(0, t, λ 0 ) < e -r t and as a consequence

+∞ 0 e -r tB(0, t, λ 0 )d t < +∞ 0 e -r td t = 1/r (68)
which implies that ρ 0 > 0.

Valuation of the prepayment option

The valuation problem of the prepayment option can be modelled as an American call option on a risky debt owned by the borrower. Here the prepayment option allows borrower to buy back and refinance his/her debt according to the current contractual margin at any time during the life of the option. As the perpetual loan, the option value will be assumed independent of the time t.

As discussed above, the prepayment exercise results in a payoff (ξ(t, T, λ) -K) + for the borrower. The option is therefore an American call option on the risky asset ξ(t, T, λ t ) and the principal K (the amount to be reimbursed) being the strike. Otherwise we can see it as an American option on the risky λ t with payoff,

χ(t, λ) := (ξ(t, λ) -K) + (69)
or, for our perpetual option:

χ(λ) := (ξ(λ) -K) + . ( 70
)
We will denote by A the characteristic operator (cf. [59, Chapter 7.5]) of the CIR process i.e. the operator that acts on any C 2 class function v by

(Av)(λ) = γ(θ -λ)∂ λ v(λ) + 1 2 σ 2 λ∂ λλ v(λ). (71)
Denote for a, b ∈ R and x ≥ 0 by U (a, b, x) the solution to the confluent hypergeometric differential (also known as the Kummer) equation [START_REF] Abramowitz | Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables[END_REF]:

xz (x) + (b -x)z (x) -az(x) = 0 (72)
that increase at most polynomially at infinity and is finite (not null) at the origin. Recall also that this function is proportional to the the confluent hypergeometric function of the second kind U (a, b, x) (also known as the Kummer's function of the second kind, Tricomi function, or Gordon function); for a, x > 0 the function U (a, b, x) is given by the formula:

U (a, b, x) = 1 Γ(a) +∞ 0 e -xt t a-1 (1 + t) b-a-1 dt. ( 73
)
When a ≤ 0 one uses other representations (see the cited references; for instance one can use a direct computation or the recurrence formula

U (a, b, x) = (2a -b + z -2)U (a + 1, b, x) -(a + 1)(a -b + 2)U (a + 2, b, x))
; it is known that U (a, b, x) behaves as x -a at infinity. Also introduce for x ≥ 0:

W (x) = e x γ-h σ 2 x σ 2 -2γθ σ 2 U - -rσ 2 -σ 2 h + γ 2 θ + γhθ σ 2 h , 2 - 2γθ σ 2 , 2h σ 2 x , (74)
where h = γ 2 + 2σ 2 .

Theorem 5 1. Introduce for Λ > 0 the family of functions: P Λ (λ) such that:

P Λ (λ) = χ(λ) ∀λ ∈ [0, Λ] (75) (AP Λ )(λ) -(r + λ)P Λ (λ) = 0, ∀λ > Λ (76) lim λ→Λ P Λ (λ) = χ(Λ), (77)
lim λ→∞ P Λ (λ) = 0. (78)
Then

P Λ (λ) = χ(λ) ∀λ ∈ [0, Λ] χ(Λ) W (Λ) W (λ) ∀λ ≥ Λ. ( 79
)
2. Suppose now a Λ * ∈]0, ρ 0 ∧ λ 0 [ exists such that:

dP Λ * (λ) dλ λ=(Λ * ) + = dχ(λ) dλ λ=(Λ * ) - . ( 80
)
Then the price of the prepayment option is P (λ) = P Λ * (λ).

Proof. We start with the first item: it is possible to obtain a general solution of (76) in an analytic form. We recall that z(X) = U (a, b, X) is the solution of the Kummer equation (72). A cumbersome but straightforward computation shows that the general solution vanishing at infinity of the PDE (76

) is W (λ) thus P Λ (λ) = C Λ W (λ) ∀λ > Λ (81)
with some C Λ > 0 to be determined. Now use the boundary conditions. If

λ = Λ by continuity χ(Λ) = P Λ (Λ) = C Λ W (Λ). Thus, C Λ = χ(Λ) W (Λ)
. Division by W is legitimate because by definition, W (x) > 0 for all x > 0.

We now continue with the second part of the theorem. The valuation problem of an American option goes through several steps: first one introduces the admissible trading and consumptions strategies cf. [START_REF] Musiela | Martingale Methods in Financial Modelling[END_REF]Chapter 5]; then one realizes using results in cited reference (also see [START_REF] Myneni | The pricing of the American option[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF]) that the price P (λ) of the prepayment option involves computing a stopping time associated to the payoff. Denote by T the ensemble of (positive) stopping times; we conclude that:

P (λ) = sup τ ∈T E(e -τ 0 r+λudu χ(λ τ )|λ 0 = λ). (82)
Further results derived for the situation of a perpetual (standard) American put options [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF][START_REF] Bensoussan | On the theory of option pricing[END_REF] show that the stopping time has a simple structure: a critical level exists that split the positive axis into two regions: to the left the exercise region where it is optimal to exercise and where the price equals the payoff and a continuation region (to the right) where the price satisfies a partial differential equation similar to Black-Scholes equation. We refer to [START_REF] Chesney | Analytical solutions for the pricing of American bond and yield options[END_REF] for how to adapt the theoretical arguments for the situation when the dynamics is not Black-Scholes like but a CIR process.

The result builds heavily on the fact that the discounted payoff of the standard situation of an American put e -rt (S -K) -, is a submartingale. For us the discounted payoff is

e -t 0 r+λudu χ(λ t ) = e -t 0 r+λudu (ξ(λ t ) -K) + (83)
and checking this condition requires here more careful examination which is the object of Lemma 7.2. It is now possible to apply Thm. 10.4.1 [59, Section 10.4 page 227] (see also [START_REF] Chesney | Analytical solutions for the pricing of American bond and yield options[END_REF] for specific treatment of the CIR process) which will show that P (λ) is the true option price if the following conditions are satisfied: The theorem also says that the borrower exercises his option on the exercise region [0, Λ * ] while on the continuation region ]Λ * , ∞[ the borrower keeps the option because it is worth more non-exercised.

We now show that P Λ * verifies all conditions above which will allow to conclude that P = P Λ * . The requirement 1 is proved in Lemma 7.2; the requirement 3 amounts at asking that the optimal frontier value Λ * be chosen such that:

dP Λ * (λ) dλ λ=(Λ * ) + = dχ(λ) dλ λ=(Λ * ) - . (85)
The requirement 2 implies that in the continuation region the price is the solution of the following PDE:

(AP )(λ) -(r + λ)P (λ) = 0, ∀λ > Λ * . ( 86
)
For this PDE we need boundary conditions. The condition at λ = Λ * is

P (λ) λ=Λ * = χ(λ) λ=Λ * . ( 87
)
When λ = +∞ the default intensity is infinite thus the time to failure is zero thus the borrower has failed ; in this case the option is worthless i.e.

lim λ→∞ P (λ) = 0. ( 88
)
These conditions give exactly the definition of P Λ * , q.e.d.

Lemma. The following inequality holds:

(Aχ)(λ) -(r + λ)χ(λ) < 0, ∀λ < ρ 0 ∧ λ 0 . (89)
Proof. Recall that χ(λ) = (ξ(λ) -K) + ; the definition (60) of ξ implies (cf. [59, Section 8.2 and exercise 9.12 p 203]) that ξ is solution of the following PDE:

(Aξ)(λ) -(r + λ)ξ(λ) + (r + ρ 0 )K = 0, ∀λ > 0. ( 90
)
For λ < λ 0 we have ξ(λ) > K = ξ(λ 0 ) thus

A(ξ(•) -K) + (λ) -(r + λ)(ξ(λ) -K) + (91) = A(ξ(•) -K) (λ) -(r + λ) ξ(λ) -K (92) = (Aξ)(λ) -(r + λ)ξ(λ) + (r + λ)K (93) = -(r + ρ 0 )K + (r + λ)K = (λ -ρ 0 )K < 0 ∀λ < ρ 0 ∧ λ 0 . (94)
Note that the Theorem 5 is only a sufficient result (a so-called "verification" result) ; under the assumption that a Λ * fulfilling the hypotheses of the Theorem exist the question is how to find it.

Two approaches can be considered; first, it is enough to find a zero of the following function Λ → Υ(Λ) := ∂P Λ (λ)

∂λ λ=Λ + -∂χ(λ) ∂λ λ=Λ -
P Λ (λ) = E(e -τ Λ 0 r+λudu χ(λ τ Λ )|λ 0 = λ). (95)
From (82) P (λ) ≥ P Λ (λ) for any λ thus Λ * is the value that maximizes (with respect to Λ) the function Λ → P Λ (λ 0 ). To comply with the theorem the maximization is performed in the interval [0, λ 0 ∧ ρ 0 ].

Numerical Application

We consider a perpetual loan (T = +∞) with a nominal amount K = 1 and the borrower default intensity λ t follows a CIR dynamics with parameters: initial intensity λ 0 = 300 bps, volatility σ = 0.05, average intensity θ = 200 bps, reversion coefficient γ = 0.5. We assume a constant interest rate r = 300bps i.e., r = 3%. Recall that a basis point, denoted "1 bps" equals 10 -4 .

Λ

Figure 11: We illustrate here the dependence of P Λ (λ 0 ) as a function of Λ; this allows to find the optimal value Λ * that maximize the option price. For the numerical example described here we obtain Λ * = 123 bps.

In order to find the initial contractual margin we use equation ( 66) and find ρ 0 = 208 bps.

At inception, the present value of cash flows is at par, so ξ(λ 0 ) = 1. The prepayment option price is P (+∞, λ 0 ) = 0.0232 i.e., P (λ 0 ) = 2.32% • K. Therefore the loan value equals ξ(λ 0 ) -P (λ 0 ) = 0, 9768.

The value Λ * = 123 bps is obtained by maximizing P Λ (λ 0 ) as indicated in the Remarks above; the dependence of P Λ (λ 0 ) with respect to Λ is illustrated in Figure 11. The loan value will equal to par if the intensity decreases until the exercise region (λ < Λ * ) see Figures 12. The continuation and exercise regions are depicted in Figure 13. We postpone to Section 8.5 the description of the numerical method to solve (76).

Perpetual prepayment option with a switching regime

In this second part, the perpetual prepayment option is still an option on the credit risk, intensity, but now also the liquidity cost. The liquidity cost is defined as the specific cost of a bank to access the cash on the market. This cost will be modelled with a switching regime with a Markov chain of finite states of the economy. The interest rate r is still assumed constant. Therefore, the assessment of the loan value and its prepayment option is a λ N -dimensional problem. The intensity is still defined by a Cox-Ingersoll-Ross process with 2kθ ≥ σ 2 :

dλ t = γ(θ -λ t )dt + σ λ t dW t , λ 0 = λ 0 . (96)

Theoretical regime switching framework

We assume the economic state of the market is described by a finite state Markov chain X = {X t , t ≥ 0}. The state space X can be taken to be, without loss of generality, the set of unit vectors E = {e 1 , e 2 , ..., e N }, e i = (0, ..., 0, 1, 0, ..., 0) T ∈ R N . Here T is the transposition operator.

Assuming the process X t is homogeneous in time and has a rate matrix

A, then if p t = E[X t ] ∈ R N , dp t dt = Ap t (97)
and,

X t = X 0 + t 0 AX u du + M t , (98)
where M = {M t , t ≥ 0} is a martingale with respect to the filtration generated by X. In differential form

dX t = AX t dt + dM t , X 0 = X 0 . (99)
We assume the instantaneous liquidity cost of the bank depends on the state X of the economy, so that

l t = l, X t (100)
Denote by a k,j the entry on the line k and the column j of the N × N matrix A with a k,j ≥ 0 for j = k and N j=1 a k,j = 0 for any k.

Analytical formulas for the PVRP

Assume a loan has a fixed coupon defined by the constant interest rate r and an initial contractual margin ρ 0 calculated at the inception for a par value of the loan. Let ξ(t, T, λ t , X t ) be, the present value of the remaining payments at time t of a corporate loan where: λ t is the intensity at time t; T is the contractual maturity; K is the nominal amount and X t is the state of the economy at time t.

The loan value LV (t, T, λ) is still equal to the present value of the remaining payments ξ(t, T, λ) minus the prepayment option value P (t, T, λ). LV (t, T, λ) = ξ(t, T, λ) -P (t, T, λ)

The PVRP ξ is the present value of the cash flows discounted at the risky rate, where the risky rate at time t is the constant risk-free rate r plus the liquidity cost l t and the intensity λ t . Similar to the discussion in the Subsection 7.1, ξ is not depending on time when T = +∞ (perpetual loan). So we denote,

ξ(λ, X) := K (r + ρ 0 ) E +∞ 0 e -t 0 r+lu+λudu d t λ 0 = λ, X 0 = X (102)
We consider that there is no correlation between the credit risk, i.e., the intensity λ t , of the borrower and the cost to access the cash on the market, i.e. the liquidity cost l t , of the lender. Therefore, we have,

ξ(λ, X) = K (r + ρ 0 ) +∞ 0 e -r tE e -t 0 λudu λ 0 = λ ×E e -t 0 ludu X 0 = X d t (103) Remark 6
The crucial information here is that the coefficients γ, θ, σ of the CIR process are not depending on the regime X thus we can separate the CIR dynamics and the Markov dynamics at this level. A different approach can extend this result by using the properties of the PVRP as explained in the next section.

Note that (cf. Subsection 7.1 equation ( 62))

E e -t 0 λudu λ 0 = λ = B(0, t, λ) (104)
and B(0, t, λ) is evaluated using equations (63) -(66). In order to compute E e -t 0 ludu X 0 = X let f k (t) be defined by:

f k (t) = E e -t 0 ludu X 0 = e k . ( 105
)
Let τ , the time of the first jump from X 0 =< X, e k > to some other state. We know (cf. Lando [START_REF] Lando | Credit Risk Modeling[END_REF] paragraph 7.7 p 211) that τ is a random variable following an exponential distribution of parameter α k with,

α k = j =k a k,j (106)
We also know that conditional to the fact that a jump has occurred at time τ the probability that the jump is from state e k to state e j is p k,j , where

p k,j = a k,j α k (107)
Thus,

f k (t) = P(τ > t)e -l k t + P(τ ≤ t)e -l k τ j =k P(l τ = l j )E e -t τ ludu X τ =< X, e j > = e -(l k +α k )t + α k t 0 e -(l k +α k )τ j =k p k,j f j (t -τ )dτ
Then,

e (l k +α k )t f k (t) = 1 + α k t 0 e (l k +α k )(t-τ ) j =k p k,j f j (t -τ )dτ = 1 + α k t 0 e (l k +α k )s j =k p k,j f j (s)ds
By differentiation with respect to t:

d dt e (l k +α k )t f k (t) = α k e (l k +α k )t j =k p k,j f j (t) Then df k (t) dt + (l k + α k )f k (t) = α k j =k p k,j f j (t) Thus, df k (t) dt = j =k α k p k,j f j (t) -(l k + α k )f k (t) (108)
Denote F (t) = (f 1 (t), f 2 (t), ..., f N (t)) T and introduce the N × N matrix B,

B i,j = α i p i,j if i = j -(α i + l i ) if i = j (109)
From equation ( 108) we obtain,

dF (t) dt = BF (t) thus F (t) = e Bt F (0) (110)
with the initial condition,

F (0) = f k (0) N k=1 = (1, 1, ..., 1) T ∈ R N . (111)
We have therefore analytical formulas for the PVRP ξ(λ, X). We refer the reader to [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] for similar considerations on a related CIR switched dynamics.

Remark 7 When all liquidity parameters l k are equal (to some quantity l) then B = A -l • Id and then we obtain (after some computations) that f k (t) = e -lt thus the payoff is equal to that of a one-regime dynamics with interest rate r + l, which is consistent with intuitive image we may have. Another limiting case is when the switching is very fast, see also Remark 26 item 5 for further details.

The margin ρ 0 is set to satisfy the equilibrium equation

ξ(λ 0 , X 0 ) = K. ( 112
)
Similar arguments to that in previous section show that ρ 0 > min k l k > 0.

See Remark 22 for the situation when a additional commercial margin is to be considered. We will also need to introduce for any k = 1, ..., N the value

Λ 0 k such that ξ(Λ 0 k , e k ) = K. ( 113
)
Of course, Λ 0 X 0 = λ 0 . Recall that ξ(λ, e k ) is decreasing with respect to λ; when ξ(0, e k ) < K there is no solution to eqn. (112) and we will choose by convention Λ 0 k = 0.

Further properties of the PVRP ξ

It is useful for the following to introduce a PDE formulation for ξ. To ease the notations we introduce the operator A R that acts on functions v(λ, X) as follows:

(A R v)(λ, e k ) = (Av)(λ, e k )-(r +l k +λ)v(λ, e k )+ N j=1 a k,j v(λ, e j )-v(λ, e k ) .
(114) Having defined the dynamics (96) and (99) one can use an adapted version of the Feynman-Kac formula in order to conclude that PVRP defined by (102) satisfies the equation:

(A R ξ) + (r + ρ 0 )K = 0. ( 115
)
Remark 8 When the dynamics involves different coefficients of the CIR process for different regimes (cf. also Remark 19) the Equation (115) changes in that it will involve, for ξ(•, e k ), the operator

A k (v)(λ) = γ k (θ k -λ)∂ λ v(λ) + 1 2 σ 2 k λ∂ λλ v(λ). (116)
instead of A.

Valuation of the prepayment option

The valuation problem of the prepayment option can be modelled as an American call option on a risky debt owned by the borrower with payoff:

χ(λ, X) = (ξ(λ, X) -K) + . (117)
Here the prepayment option allows borrower to buy back and refinance his/her debt according to the current contractual margin at any time during the life of the option.

Theorem 9 For any N-tuple Λ = (Λ k ) N k=1 ∈ (R + ) N introduce the function P Λ (λ, X) such that:

P Λ (λ, e k ) = χ(λ, e k ) ∀λ ∈ [0, Λ k ] (118) (A R P Λ )(λ, e k ) = 0, ∀λ > Λ k , k = 1, ..., N (119) lim λ→Λ k P Λ (λ, e k ) = χ(Λ k , e k ), k = 1, ..., N (120)
lim λ→∞ P Λ (λ, e k ) = 0, k = 1, ..., N. (121)
Suppose a Λ * ∈ N k=1 [0, (ρ 0 -l k ) + ∧ Λ 0 k ] exists such that for all k = 1, ..., N :

P Λ * (λ, X) ≥ χ(λ, X) ∀λ, X (122) ∂P Λ * (λ, e k ) ∂λ λ=(Λ * k ) + = ∂χ(λ, e k ) ∂λ λ=(Λ * k ) - if Λ * k > 0 (123) N j=1 a k,j P Λ * (λ, e j ) -χ(λ, e j ) + K(λ + l k -ρ 0 ) ≤ 0 ∀λ ∈] min j Λ * j , Λ * k [. ( 124
)
Then P = P Λ * .
Proof. Similar arguments as in the proof of Thm. 5 lead to consider the American option price in the form

P (λ, X) = sup τ ∈T E e -τ 0 r+lu+λudu χ(λ τ , X τ ) λ 0 = λ, X 0 = X .
We note that for Λ ∈ (R * + ) N if τ Λ is the stopping time that stops upon exiting the domain λ > Λ k when X = e k then

P Λ (λ, X) = E e -τ Λ 0 r+lu+λudu χ(λ τ Λ , X τ Λ ) λ 0 = λ, X 0 = X .
Remark that for Λ ∈ (R * + ) N the stopping time τ Λ is finite a.e. Thus for any Λ ∈ (R * + ) N we have P ≥ P Λ ; when Λ has some null coordinates the continuity (ensured among others by the boundary condition ( 118)) shows that we still have P ≥ P Λ . In particular for Λ * we obtain P ≥ P Λ * ; all that remains to be proved is the reverse inequality i.e. P ≤ P Λ * .

To this end we use a similar technique as in Thm. 10.4.1 [59, Section 10.4 page 227] (see also [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] for similar considerations). First one can invoke the same arguments as in cited reference (cf. Appendix D for technicalities) and work as if P Λ * is C 2 (not only C 1 as the hypothesis ensures).

Denote

D Λ * = {(λ, e k )|λ ∈ [0, Λ * k ], k = 1, .
.., N } (which will be the exercise region) and C Λ * its complementary with respect to R + × E (which will be the continuation region).

The Lemma 18.5 shows that A R P Λ * is non-positive everywhere (and is null on C Λ * ). The Îto formula shows that

d e -t 0 r+ls+λsds P Λ * (λ t , X t )) = e -t 0 r+ls+λsds (A R P Λ * )(λ t , X t ))dt+d(martingale) (125)
Taking averages and integrating from 0 to some stopping time τ it follows from A R P Λ * ≤ 0 that

P Λ * (λ, X) ≥ E e -τ 0 r+lu+λudu P Λ * (λ τ , X τ ) λ 0 = λ, X 0 = X ≥ E e -τ 0 r+lu+λudu χ(λ τ , X τ ) λ 0 = λ, X 0 = X .
Since this is true for any stopping time τ the conclusion follows.

Lemma. Under the hypothesis of the Thm. 24 the following inequality holds (strongly except for the values (λ, X) = (Λ * j , e k ) and everywhere in a weak sense):

(A R P Λ * )(λ, X) ≤ 0, ∀λ > 0, ∀X. (126)
Proof. The non-trivial part of this lemma comes from the fact that if for fixed k we have for λ in a neighbourhood of some λ 1 : P Λ * (λ, e k ) = χ(λ, e k ) this does not necessarily imply

(A R P Λ * )(λ 1 , e k ) = (A R χ)(λ 1 , e k ) because A R
depends on other values P Λ * (λ, e j ) with j = k.

From (119) the conclusion is trivially verified for X = e k for any λ ∈ ]Λ * k , ∞[. We now analyse the situation when λ < min j Λ * j ; this means in particular that 0 ≤ λ < min j Λ * j ≤ Λ 0 for any thus Λ 0 > 0. Note that

Λ * k < Λ 0 k implies ξ(Λ * k , e k ) ≥ ξ(Λ 0
k , e k ) = K for any k = 1, ..., N thus χ(λ, e k ) = ξ(λ, e k ) -K for any λ ∈ [0, Λ * k ] and any k. Furthermore since λ < min j Λ * j we have P Λ * (λ, e k ) = χ(λ, e k ) = ξ(λ, e k ) -K for any k. Fix X = e k ; then

(A R P Λ * )(λ, e k ) = (A R χ)(λ, e k ) = (A R (ξ -K))(λ, e k ) = (A R ξ)(λ, e k ) -A R (K) = -(r + ρ 0 )K -(r + l k + λ)K = K(l k + λ -ρ 0 ) ≤ K(l k + Λ * k -ρ 0 ) ≤ 0 (127)
the last inequality being true by hypothesis. A last situation is when λ ∈] min j Λ * j , Λ * k [; there P Λ * (λ, e k ) = χ(λ, e k ) but some terms P Λ * (λ, e j ) for j = k may differ from χ(λ, e j ). More involved arguments are invoked in this case. This point is specific to the fact that the payoff χ itself has a complex structure and as such was not emphasized in previous works (e.g., [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF], etc.).

Recalling the properties of ξ one obtains (and since P Λ * (λ, e k ) = χ(λ, e k )):

(A R P Λ * )(λ, e k ) = (Aχ)(λ, e k ) -(r + l k + λ)χ(λ, e k ) + N j=1 a k,j P Λ * (λ, e j ) -χ(λ, e k ) = (A R χ)(λ, e k ) + N j=1 a k,j P Λ * (λ, e j ) -χ(λ, e j ) = (A R ξ)(λ, e k ) -A R (K) + N j=1 a k,j P Λ * (λ, e j ) -χ(λ, e j ) = -K(r + ρ 0 ) + (r + l k + λ)K + N j=1 a k,j P Λ * (λ, e j ) -χ(λ, e j ) ≤ 0, (128)
where for the last inequality we use hypothesis (124). Finally, since we proved that (A R P Λ * )(λ, X) ≤ 0 strongly except for the values (λ, X) = (Λ * j , e k ) and since P Λ * is of C 1 class we obtain the conclusion (the weak formulation only uses the first derivative of P Λ * ).

Remark 10 Several remarks are in order at this point:

1. when only one regime is present i.e., N = 1 the hypothesis of the Theorem are identical to that of Thm. 5 since (124) is automatically satisfied.

2. when N > 1 checking (124) does not involve any computation of derivatives and is straightforward.

3. as mentioned in the previous section, the Theorem is a verification result i.e., only gives sufficient conditions for a candidate to be the option price. Two possible partial converse results are possible: a first one to prove that the optimal price is indeed an element of the family P Λ . A second converse result is to prove that supposing or by maximizing on N k=1 ]0, (ρ 0 -l k )∧Λ 0 k [ the function Λ → P Λ (λ 0 , X 0 ).

P = P Λ * then Λ * ∈ N k=1 [0, (ρ 0 -l k ) + ∧ Λ 0 k ] and (
5. if the optimization of P Λ (λ 0 , X 0 ) is difficult to perform, one can use a continuation argument with respect to the coupling matrix A. Denote by Λ * (A) the optimal value of Λ * as function of A. When A = 0 each Λ * k is found as in Section 7 (the problem separates into N independent i.e., no coupled, valuation problems, each of which requiring to solve a one dimensional optimization) and we construct thus Λ * (0). When considering µA with µ → ∞ at the limit the optimal Λ * (∞A) has all entries equal to Λ * mean where Λ * mean is the optimal value for a oneregime (N = 1) dynamics with riskless interest rate r being replaced by r +

Numerical Application

The numerical solution of the partial differential equation ( 119) is required. We use a finite difference method. The first derivative is approximated by the finite difference formula:

∂ ∂λ P Λ (λ, X) = P Λ (λ + δλ, X) -P Λ (λ -δλ, X) 2δλ + O(δλ 2 ) (129)
while the second derivative is approximated by:

∂ 2 ∂λ 2 P Λ (λ, X) = P Λ (λ + δλ, X) -2P Λ (λ + δλ, X) + P Λ (λ -δλ, X) δλ 2 + O(δλ 2 )
(130) To avoid working with an infinite domain a well-known approach is to define an artificial boundary λ max . Then a boundary condition is imposed on λ max which leads to a numerical problem in the finite domain

∪ N k=1 [Λ * k , λ max ].
In this numerical application, λ max = 400 bps. We discretise [Λ * , λ max ] with a grid such that δλ = 1bps. Two approaches have been considered for imposing a boundary value at λ max : either consider that P Λ (λ max , e k ) = 0, ∀k = 1, ..., N (homogenous Dirichlet boundary condition) or that ∂ ∂λ P Λ (λ max , e k ) = 0, ∀k = 1, ..., N (homogeneous Neuman boundary condition). Both are correct in the limit λ max → ∞. We tested the precision of the results by comparing with numerical results obtained on a much larger grid (10 times larger) while using same δλ. The Neumann boundary condition gives much better results for the situations we considered and as such was always chosen (see also Figure 16).

We consider a perpetual loan with a nominal amount K = 1 and the borrower default intensity λ t follows a CIR dynamics with parameters: initial intensity λ 0 = 300bps, volatility σ = 0.05, average intensity θ = 200bps, reversion coefficient γ = 0.5. We assume a constant interest rate r = 1% and a liquidity cost defined by a Markov chain of two states l 1 = 150bps and l 2 = 200bps. For N = 2 the rate A matrix is completely defined by α 1 = 1/3, α 2 = 1.

In order to find the initial contractual margin we use equation ( 66) and find ρ 0 = 331 bps in the state 1. The contractual margin takes into account the credit risk (default intensity) and the liquidity cost. We have thus Λ 0 1 = λ 0 ; we obtain then Λ 0 2 = 260bps. The optimal value Λ * is obtained by maximizing P Λ (λ 0 , X 0 ) and turns out to be (Λ * 1 , Λ * 2 ) = (122bps, 64bps), see Figure 14. To be accepted, this numerical solution has to verify all conditions of the Theorem 24. The hypothesis (122) and (124) are satisfied (see Figure 16) and the hypothesis (124) is accepted after calculation. Moreover Λ * 1 ≤ (ρ 0 -l 1 ) ∧ Λ 0 1 and the analogous holds for Λ * 2 . In the state X 0 = 1, the present value of cash flows is at par, so ξ(λ 0 , X 0 ) = 1. The prepayment option price is P (λ 0 , X 0 ) = 0.0240. Therefore the loan value equals ξ(λ 0 , X 0 ) -P (λ 0 , X 0 ) = 0.9760.

The loan value will equal to the nominal if the intensity decreases until the exercise region λ ≤ Λ * see Figure 15. The continuation and exercise regions are depicted in Figure 16.

Regimes when is never optimal to exercise

When the liquidity parameters corresponding to given regimes are very different it may happen that the optimization of P Λ (λ 0 , X 0 ) over Λ gives an optimum value Λ * with some null coordinates Λ k i , i = 1, .... This may hint to the fact that in this situation it is never optimal to exercise during the regimes e k i , i = 1, .... This is not surprising in itself (remember that this is the case of an American call option) but needs more care when dealing with. Of course when in addition Λ 0 k i = 0 the payoff being null it is intuitive that the option should not be exercised.

Remark 11 Further examination of the Theorem 5 calls for the following remarks:

Figure 14: We illustrate here the dependence of P Λ (λ 0 , X 0 ) as a function of Λ; this allows to find the optimal (Λ * 1 = 122bps, Λ * 2 = 64bps) that maximizes the option price. 1. the boundary value set in eqn. (118) for some regime e k with Λ * k = 0 deserves an interpretation. The boundary value does not serve to enforce continuity of λ → P Λ (λ) because there is no exercise region in this regime thus any value will do. Moreover when 2γθ ≥ σ 2 the intensity λ u does not touch 0 thus the stopping time τ Λ * is infinite in the regime e k (thus the boundary value in 0 can be set to any arbitrary number since it is never used). The real meaning of the value P Λ * (0, e k ) comes from arbitrage considerations: when one proves in the demonstration of the Theorem that P ≥ P Λ * one uses continuity of P Λ with respect to the parameter Λ; in order to still have this conclusion one has to set P Λ * (0, e k ) ≤ lim Λ∈(R * + ) N →Λ * P Λ (0, e k ) = χ(0, e k ). On the contrary, in order to have P ≤ P Λ * , since P ≥ χ is it required that P Λ * (0, e k ) ≥ P (0, e k ) ≥ χ(0, e k ). Thus only P Λ * (0, e k ) = χ(0, e k ) can prevent arbitrage.

it is interesting to know when such a situation can occur and how can

one interpret it. Let us take a two-regime case (N = 2): l 1 a "normal" regime and l 2 the "crisis" regime (l 2 ≥ l 1 ); when the agent contemplates prepayment the more severe the crisis (i.e. larger l 2l 1 ) less he/she is likely to prepay during the crisis the cash is expensive (high liquidity cost). We will most likely see that for l 1 = l 2 some exercise region exists while starting from some large l 2 the exercise region will disappear in regime e 2 . This is completely consistent with the numerical results reported in this paper.

Numerical Application

We consider the same situation as in Section 8.7 except that l 1 = 50bps and l 2 = 250 bps. In order to find the initial contractual margin we use equation ( 66) and find ρ 0 = 305 bps in the state 1. The contractual margin takes into account the credit risk (default intensity) and the liquidity cost.

As before Λ 0 1 = λ 0 but here we obtain Λ 0 2 = 221bps. The couple (Λ * 1 = 121bps, Λ * 2 = 0) (see Figure 17) maximizes P Λ (λ 0 , X 0 ). There does not exist a exercise boundary in the state 2. The loan value will equal the par if the intensity decreases until the exercise region λ ≤ Λ * see Figure 18. The continuation and exercise regions are depicted in Figure 19.

To be accepted as true price the numerical solution P Λ * has to verify all hypothesis and conditions of the Theorem 24. In the regime X = e 1 , the hypothesis ( 122) and ( 123) are verified numerically (see also Figure 19) and the hypothesis (124) is accepted after calculation. Moreover

Λ * k ≤ (ρ 0 -l k ) ∧ Λ 0 k for k = 1, 2.
In the state X = e 1 , the present value of cash flows is at par, so ξ(λ 0 , X 0 ) = K = 1. The prepayment option price is P (λ 0 ) = 0.0245. Therefore the loan value LV equals ξ(λ 0 ) -P (λ 0 ) = 0.9755.

Concluding remarks

We proved in this paper two sufficient theoretical results concerning the prepayment option of corporate loans. In our model the interest rate is constant, the default intensity follows a CIR process and the liquidity cost follows a discrete space Markov jump process. The theoretical results were implemented numerically and show that the prepayment option cost is not negligible and should be taken into account in the asset liability management of the bank. Moreover it is seen that when liquidity parameters are very different (i.e., when a liquidity crisis occur) in the high liquidity cost regime the exercise domain may entirely disappear, meaning that it is not optimal for the borrower to prepay during such a liquidity crisis.

Λ Λ

Figure 17: We illustrate here the dependence of P Λ (λ 0 , X 0 ) as a function of the exercise boundary Λ; this allows to find the optimal (Λ * 1 = 121bps, Λ * 2 = 0) that maximizes the option price.

Part III

Perpetual corporate loans: Two-dimensional space-time model Abstract We investigate in this part a perpetual prepayment option related to a corporate loan. Now, we assume that the short interest rate and default intensity of the firm are supposed to follow CIR processes. A liquidity term that represents the funding costs of the bank is introduced and modelled as a continuous time discrete state Markov chain. The prepayment option needs specific attention as the payoff itself is a derivative product and thus an implicit function of the parameters of the problem and of the dynamics. We prove verification results that allows to certify the geometry of the exercise region and compute the price of the option. We show moreover that the price is the solution of a constrained minimization problem and propose a numerical algorithm building on this result. The algorithm is implemented in a two-dimensional code and several examples are considered. It is found that the impact of the prepayment option on the loan value is not to be neglected and should be used to assess the risks related to client prepayment. Moreover the Markov chain liquidity model is seen to describe more accurately clients' prepayment behaviour than a model with constant liquidity.

Introduction

When a company needs money it can turn to its bank which lends it against e.g., periodic payments in the form of a loan. A loan contract issued by a bank for its corporate clients is a financial agreement that often comes with more flexibility than a retail loan contract. These options are designed to meet clients' expectations and can include e.g., a prepayment option (which entitles the client, if he desires so, to pay all or a fraction of its loan earlier than the maturity), a multi-currency option, a multi-index option, etc. On the other hand, there are also some mechanisms to protect the lender from the deterioration of the borrower's credit quality e.g., a pricing grid based on the borrower's rating or protecting guaranties.

The main option remains however the prepayment option and is the subject of this work. The company can prepay a fraction or 100% of the nominal and it will do so when its credit profile improves so that it can refinance its debt at a cheaper rate.

In order to decide whether the exercise of the option is worthwhile the borrower compares the remaining payments (actualized by the interest rate he can obtain at that time) with the nominal value K. If the remaining payments exceed the nominal value then it is optimal for the borrower to prepay.

When the interest rates are not constant or the borrower is subject to default the computation of the actualization is less straightforward. It starts with considering all possible scenarios of evolution for interest rate and default intensity in a risk-neutral framework in order to compute the average value of remaining payments (including the final payment of the principal if applicable); this quantity will be called "P V RP "(denoted ξ) and is the present value of the remaining payments i.e., the cash amount equivalent, both for borrower and lender, of the value of remaining payments. Then ξ is compared with the nominal K : if ξ ≥ K then the borrower should prepay, otherwise not. Recall that at the initial time the payments correspond to a rate, the sum of the (variable) short term interest rate (e.g., LIBOR or EU-RIBOR) and a contractual margin ρ 0 chosen such that ξ = K at origination. Note that in order to compute the price of the embedded prepayment option the lender also uses the P V RP as it will be seen below.

The bank that proposes the loan finances it through a bond program (possibly mutualized for several loans) at some spread depending on its own credit profile and market conditions. In order for the corporate loan to be profitable the rate of the bond, that is also indexed on LIBOR or EURIBOR, has to be lower than the rate of the loan. This condition is easy to check at the origination of both contracts and is always enforced by the bank. However if the client prepays the bank finds itself in a non-symmetric situation: the periodic interest payments from client is terminated but the bank still has to pay the interests and principal of its own bond; the bond does not have a prepayment option or such an option is costly. The risk is that the amount K received from the client at prepayment time cannot be invested in another product with interest rate superior to that of the bond.

Thus a first question is how should the bank fund its corporate loans and handle the prepayment risk. This is a valuation problem.

An even more important question is to know whether it is possible that many clients decide to prepay at the same time. This circumstance can happen e.g., when a crisis is over and clients can again borrow at 'normal', lower, rates. We address this question by introducing liquidity regimes to model funding costs.

Liquidity is the key of the stability of the entire financial system and can cause banks' failures if systemic liquidity squeezes appear in the financial industry. Historical events like the Asian crisis of 1997; the Russian financial crisis of 1998; the defaults of hedge funds and investment firms like LTCM, Enron, Worldcom and Lehman Brothers; sovereign debts crisis of 2010-11, ... etc., prove that banks hold significant liquidity risk in their balance sheets. Even if liquidity problems have a very low probability to occur, a liquidity crisis can have a severe impact on a bank's funding costs, its market access (reputation risk) and short-term funding capabilities.

Following the state of the economic environment, the liquidity can be defined by distinct states. Between two crises, investors are confident and banks find it easy to launch their long term refinancing programs through regular bonds issuances. Thus the liquidity market is stable. On the contrary, during crisis liquidity becomes scarce, pushing the liquidity curve to very high levels; the transition between these two distinct regimes is often sudden.

In order to model the presence of distinct liquidity regimes we will simulate the liquidity cost by a continuous time observable Markov chain that can have a discrete set of possible values, one for each regime. It is seen (cf. Section 13.5) that considering several liquidity regimes explains better clients' prepayment behaviour than a constant liquidity model.

In practice it is interesting to study long-term loans that are set for more than three years and can run for more than twenty years. Note that the longest the maturity of the loan, the riskier the prepayment option. The perpetual options (i.e., with infinite time to maturity) are the object of this paper and provide a conservative estimation of the prepayment risk of any loan.

From a technical point of view this paper faces several non-standard conditions: although the goal is to value a perpetual American option the payoff of the option is highly non-standard (is dependent on the P V RP which is itself a derivative product). As a consequence the characterization of the exercise region is not standard and technical conditions have to be met. Furthermore our focus here is on a specific type of dynamics (of CIR type) with even more specific interest on the situation when several funding regimes are present.

The balance of the paper is as follows: in the remainder of this section (Sub-Section 10.1) we review the related existing literature; in Section 11 we prove a first theoretical result that allows to identify the exercise region. In Section 12 we show that the price is the solution to some constraint optimization problem which allows to construct a numerical algorithm. A 2D numerical implementation of the algorithm is the object of the Section 13 and several examples are presented.

Related literature

There exist few articles (e.g., works by Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]) on the loan prepayment option but a close subject, the prepayment option in a fixed-rate mortgage loan, has been covered in several papers by Hilliard and Kau [START_REF] Hillard | Valuing prepayment and default in a fixed-rate mortgage: A bivariate binomial options pricing technique[END_REF] and more recent works by Chen et al. [START_REF] Chen | The value of mortgage prepayment and default options[END_REF]. To approximate the PDE satisfied by the prepayment option, they define two state variables (interest rate and house price). Their approach is based on a bivariate binomial option pricing technique with a stochastic interest rate and a stochastic house value (CIR processes). Although the trinomial tree may also be computationally interesting and relevant for this problem so far no numerical implementations were proposed, to the best of our knowledge, for this specific problem.

Another contribution by Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF] applies the binomial tree technique (but of course it is time-consuming for long-term loans due to the nature of binomial trees) to corporate loans. They consider a prepayment option associated to a 1 year loan with a quarterly step but it is computationally difficult to have an accurate assessment of the option price for a 10 years loan.

There also exist mortgage prepayment decision models based on Poisson regression approach for mortgage loans. See, for example, Schwartz and Torous [START_REF] Schwartz | Mortgage prepayment and default decisions: A Poisson regression approach[END_REF]. Unfortunately, the volume and history of data are very weak in the corporate loan market to obtain reliable results.

Due to the structure of their approach, these papers did not have to consider the geometry of the exercise region because it is explicitly given by the numerical algorithm which is supposed to converge. This is not the case for us and requires that particular care be taken when stating the optimality of the solution. Furthermore, to the best of our knowledge, none of these approaches explored the circumstance when several regimes exist.

The analysis of Markov-modulated regimes has been investigated in the literature when the underlying(s) follow the Black& Scholes dynamics with drift and volatility having Markov jumps; several works are of interest in this area: Guo and Zhang [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] have derived the closed-form solutions for vanilla American put; Guo analyses in [START_REF] Guo | An explicit solution to an optimal stopping problem with regime switching[END_REF] Russian (i.e., perpetual look-back) options and is able to derive explicit solutions for the optimal stopping time; in [START_REF] Xu | Perpetual American maximum options with Markov-modulated dynamics[END_REF] Xu and Wu analyse the situation of a two-asset perpetual American option where the pay-off function is a homogeneous function of degree one; Mamon and Rodrigo [START_REF] Mamon | Explicit solutions to European options in a regime-switching economy[END_REF] find explicit solutions to vanilla European options. Buffington and Elliott [START_REF] Buffington | American options with regime switching[END_REF] study European and American options and obtain equations for the price. A distinct approach (Hopf factorization) is used by Jobert and Rogers [START_REF] Jobert | Option pricing with Markov-modulated dynamics[END_REF] to derive very good approximations of the option prices for, among others, American puts. Other contributions include [START_REF] Yao | A regime-switching model for European options[END_REF][START_REF] Tak | Pricing currency options under two-factor Markov-modulated stochastic volatility models[END_REF] etc.

A different class of contributions discuss the liquidity; among them several contributions point out that the liquidity displays "regimes" i.e. a finite list of distinctive macro-economic circumstances, see for instance [START_REF] Dionne | A reduced form model of default spreads with Markov-switching macroeconomic factors[END_REF][START_REF] Liang | On a reduced form credit risk model with common shock and regime switching[END_REF] and references within. Our situation corresponds precisely to this view as it will be seen in Section 11.

Works involving Markov switched regimes and CIR dynamics appears in [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] where the bond valuation problem is considered (but not in the form of an American option; their approach will be relevant to the computation of the payoff of our American option although in their model only the mean reverting level is subject to Markov jumps) and in [START_REF] Zhou | An accessible implementation of interest rate models with markov-switching[END_REF] where the term structure of the interest rates is analysed. A relevant connected work is [START_REF] Tak Kuen | Bond pricing under a markovian regime-switching jumpaugmented vasicek model via stochastic flows[END_REF] where the bond price is obtained when the short rate process is governed by a Markovian regime-switching jump-diffusion version of the Vasicek model; the authors provide in addition the suitable mathematical arguments to study piecewise Vasicek dynamics (here the dynamics is still piecewise but CIR).

On the other hand numerical methods are proposed in [START_REF] Huang | Methods for pricing American options under regime switching[END_REF] where it is found that a fixed point policy iteration coupled with a direct control formulation seems to perform best.

Finally, we refer to [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF] for theoretical results concerning the pricing of American options in general.

11 Perpetual prepayment option: the geometry of the exercise region

The risk neutral dynamics

The prepayment option depends on three distinct dynamics:

• the (short) interest rate r t , which follows a piecewise CIR (Cox-Ingersoll-Ross) process (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF][START_REF] Lando | Credit Risk Modeling[END_REF][START_REF] Bielecki | Credit Risk: Modeling, Valuation and Hedging[END_REF] for theoretical and numerical aspects of CIR processes and the situations where the CIR process has been used in finance);

• the default intensity λ t which also follows a piecewise CIR process

• the liquidity l t which depends on the economic environment and jumps among a finite list of states; it is described by a finite state Markov chain X = {X t , t ≥ 0}. The state space X can be taken to be, without loss of generality, the set of unit vectors E = {e 1 , e 2 , ..., e N }, e i = (0, ..., 0, 1, 0, ..., 0) T ∈ R N . Here T is the transposition operator.

Assuming the process X t is homogeneous in time and has a rate matrix A, then

X t = X 0 + t 0 AX u du + M t , X 0 = X 0 , (131)
where M = {M t , t ≥ 0} is a martingale with respect to the filtration generated by X. In differential form

dX t = AX t dt + dM t , X 0 = X 0 . ( 132
)
We assume the instantaneous liquidity cost of the bank l t is positive and depends on the state X t of the economy, so that

l t = l, X t , (133)
for some constant vector l that collects the numerical values of liquidity for all regimes e k ∈ E.

Denote by a k,j the entry on the line k and the column j of the N × N matrix A with a k,j ≥ 0 for j = k and N j=1 a k,j = 0 for any k. We model the intensity dynamics by a CIR process with parameters depending on the regime X t :

dλ t = γ λ (X t )(θ λ (X t ) -λ t )dt + σ λ (X t ) λ t dW t , λ 0 = λ 0 , (134) γ λ (X t ), θ λ (X t ), σ λ (X t ) > 0. ( 135
)
The short rate r also follows a CIR process with parameters depending on the regime X t :

dr t = γ r (X t )(θ r (X t ) -r t )dt + σ r (X t ) √ r t dZ t , r 0 = r 0 , (136) γ r (X t ), θ r (X t ), σ r (X t ) > 0. ( 137
)
In order to ease the notations we may sometimes write γ λ,k instead of γ λ (e k ) and similar notations for σ λ (e k ), θ λ (e k ), γ r (e k ), σ r (e k ) and θ r (e k ) for k = 1, ..., N .

It is known that if

2γ λ,k θ λ,k ≥ σ 2 λ,k , ∀k = 1, ..., N, (138)
then the intensity λ t is strictly positive at all times. We assume that the condition (138) is satisfied. Same hypothesis is assumed for the short rate dynamics:

2γ r,k θ r,k ≥ σ 2 r,k , ∀k = 1, ..., N. (139)
Here W t and Z t are two Brownian motions independent of the filtration generated by X. Their correlation is possibly non-null but constant i.e., with usual notations

W t , Z t = ρt, |ρ| ≤ 1. (140)
We obtain thus the following joint dynamics which is supposed to be the relevant risk-neutral dynamics for the valuation of the prepayment option:

d   X t λ t r t   =   AX t γ λ (X t )(θ λ (X t ) -λ t ) γ r (X t )(θ r (X t ) -r t )   dt+   dM t σ λ (X t ) √ λ t dW t σ r (X t ) √ r t dZ t   ,   X 0 λ 0 r 0   =   X 0 λ 0 r 0   . (141)

Remark 12

The selection of a risk-neutral dynamics (or equivalently of a pricing measure) is not a trivial task in general and even less for incomplete markets (see [START_REF] Cerny | Mathematical Techniques in Finance: Tools for Incomplete Markets[END_REF] for further details).

The PVRP

Consider a loan with an initial contractual margin ρ 0 calculated at the origination to match the par value K of the loan. At time t the client firm pays interests at rate r t + ρ 0 . Let ξ(t, T, r t , λ t , X t ) be the present value of the remaining payments at time t of the corporate loan with contractual maturity T (the interested reader can consult [START_REF] Lando | Credit Risk Modeling[END_REF][START_REF] Bielecki | Credit Risk: Modeling, Valuation and Hedging[END_REF] and references within for additional information related to ξ).

A quantity that is meaningful for the bank is the "loan value" LV (t, T, r, λ, X) defined as ξ(t, T, r, λ, X) minus the prepayment option value P (t, T, r, λ, X). LV (t, T, r, λ, X) = ξ(t, T, r, λ, X) -P (t, T, r, λ, X).

(

The PVRP ξ is the present value of the cash flows discounted at the instantaneous risky rate, where the instantaneous risky rate at time t is the short rate r t plus the liquidity cost l t plus the intensity λ t . We obtain for r > 0, λ > 0 that the P V RP is :

KE T t (r s + ρ 0 )e -s t ru+lu+λudu ds + e -T t rs+ls+λsds r t = r, λ t = λ, X t = X .
(143) For a perpetual loan T = +∞ and since r t > 0, λ t > 0 we obtain that the last term vanishes at the limit. Moreover since in the risk-neutral dynamics (141) all coefficients in the matrix A and CIR processes are time independent we conclude that ξ does not depend on t. We will define:

ξ(r, λ, X) := KE ∞ 0 (r s + ρ 0 )e -s 0 ru+lu+λudu ds r 0 = r, λ 0 = λ, X 0 = X .. (144)
Note that this implies that ξ(r, λ, e k ) is C ∞ in the neighbourhood of any (r, λ), r > 0, λ > 0 and for any k = 1, ..., N , see Section 15 for details.

The margin ρ 0 is set to satisfy the equilibrium equation

ξ(r 0 , λ 0 , X 0 ) = K, (145)
or equivalently

ρ 0 = 1 -E ∞ 0 r s e -s 0 ru+lu+λudu ds r 0 = r 0 , λ 0 = λ 0 , X 0 = X 0 E ∞ 0 e -s 0 ru+lu+λudu ds r 0 = r 0 , λ 0 = λ 0 , X 0 = X 0 > 0. ( 146
)
The last inequality is obtained from:

E ∞ 0 r s e -s 0 ru+lu+λudu ds r 0 = r 0 , λ 0 = λ 0 , X 0 = X 0 < E ∞ 0 r s e -s 0 rudu ds r 0 = r 0 , λ 0 = λ 0 , X 0 = X 0 = 1. ( 147
)
Similar arguments show that (see Section 15)

ξ(r, λ, X) ∈]0, K(1 + ρ 0 )], ∀r > 0, λ > 0, X ∈ E, (148) lim
(r,λ) →∞ ξ(r, λ, e k ) = 0, ∀k = 1, ..., N. (149)
The above results and the regularity of ξ show that ξ can be extended by continuity when r = 0 or λ = 0.

Remark 13 If an additional commercial margin ν 0 is considered then ρ 0 is first computed as above and then replaced by ρ 0 = ρ 0 + ν 0 in Equation (144). With these changes all results of the paper remain valid.

We also introduce for technical reasons the curves Γ

0 k , k = 1, ..., N : Γ 0 k = {(r, λ)|r ≥ 0, λ ≥ 0, ξ(r, λ, e k ) = K}. (150)
Of course, (r 0 , λ 0 ) ∈ Γ 0 X 0 . We also define the domains:

Ω ξ- k = {(r, λ)|r ≥ 0, λ ≥ 0, ξ(r, λ, e k ) < K}, Ω ξ+ k = {(r, λ)|r ≥ 0, λ ≥ 0, ξ(r, λ, e k ) > K}. (151)

Further properties of the PVRP ξ

It is useful for the following to introduce a PDE formulation for ξ. To ease the notations we introduce the operator A R that acts on regular functions v(r, λ, X) as follows:

(A R v)(r, λ, e k ) = (A k v)(r, λ, e k )-(r+l k +λ)v(r, λ, e k )+ N j=1 a k,j v(r, λ, e j )-v(r, λ, e k ) , (152)
where A k is the characteristic operator (cf. [59, Chapter 7.5]) of the CIR processes of r and λ in X = e k , i.e., the operator that acts on any C 2 class function v(r, λ) by

A k (v)(r, λ) = γ λ,k (θ λ,k -λ)∂ λ v(r, λ) + 1 2 σ 2 λ,k λ∂ λλ v(r, λ) +γ r,k (θ r,k -r)∂ r v(r, λ) + 1 2 σ 2 r,k r∂ rr v(r, λ) +ρ √ rλσ λ,k σ r,k ∂ rλ v(r, λ). ( 153
)
Since ξ is regular one can use an adapted version of the Feynman-Kac formula in order to conclude that ξ defined by (144) satisfies the equation:

(A R ξ)(r, λ, X) + (r + ρ 0 )K = 0, ∀r > 0, λ > 0, ∀X ∈ E. ( 154
)

Valuation of the prepayment option

The valuation problem of the prepayment option can be modelled as an American call option (on a risky debt owned by the borrower) with payoff:

χ(r, λ, X) = (ξ(r, λ, X) -K) + . (155)
Here the prepayment option allows borrower to buy back and refinance its debt according to the current contractual margin at any time during the life of the option. We denote by P the price of the prepayment option. General results that have been derived for the pricing of a perpetual (vanilla) American put option [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF][START_REF] Bensoussan | On the theory of option pricing[END_REF] show that the stopping time has a simple structure: a critical frontier splits the domain into two regions: the exercise region where it is optimal to exercise and where the price equals the payoff and a continuation region where the price satisfies a partial differential equation similar to the Black-Scholes PDE. We refer to [START_REF] Chesney | Analytical solutions for the pricing of American bond and yield options[END_REF] for how to adapt the theoretical arguments for the situation when the dynamics is not Black-Scholes but a CIR process.

The result builds heavily on the geometric properties (convexity, etc.) of the payoff, which are not available in this setting; a direct proof is therefore needed. Note that for general payoff examples are available (see for instance [START_REF] Detemple | American-Style Derivatives: Valuation and Computation[END_REF]) where several (connected) exercise and / or continuation regions exist. It is therefore not clear a priori what is the geometry of the exercise regions. We prove here a result that allows to certify that, under some technical assumptions given below, for the prepayment option at most one connected exercise region and at most one connected continuation region exist in any regime.

Theorem 14 Let Ω := (Ω k ) N k=1 be a N -tuple of connected open sets Ω k ⊂ (R + ) 2 with piecewise Lipschitz frontiers. Denote by Ω c k the interior of (R + ) 2 \ Ω k and Γ k the common frontier of Ω c
k and Ω k . Introduce the function P Ω (r, λ, X) defined by:

P Ω (r, λ, e k ) = χ(r, λ, e k ) ∀(r, λ) ∈ Ω k , k = 1, ..., N (156)
(A R P Ω )(r, λ, e k ) = 0, ∀(r, λ) ∈ Ω c k , k = 1, ..., N (157)
P Ω (r, λ, e k ) = χ(r, λ, e k ), on Γ k , k = 1, ..., N (158) lim
(r,λ) →∞ P Ω (r, λ, e k ) = 0, k = 1, ..., N. (159)
Suppose Ω * := (Ω * k ) N k=1 exists such that for all k = 1, ..., N the frontier of Ω * k is piecewise Lipschitz and:

Ω * k ⊂ Ω ξ+ k (160) P Ω * (r, λ, X) ≥ χ(r, λ, X) ∀r, λ, X (161)
P Ω * (r, λ, e k ) is of C 1 class on (R + ) 2 , k = 1, ..., N (162)
N j=1 a k,j P Ω * (r, λ, e j ) -χ(r, λ, e j ) + K(λ

+ l k -ρ 0 ) ≤ 0 ∀(r, λ) ∈ Ω * k . ( 163
)
Then P = P Ω * .
Proof. Denote by T the ensemble of (positive) stopping times; then for all k = 1, ..., N :

P (r, λ, e k ) = sup τ ∈T E e -τ 0 ru+lu+λudu χ(r τ , λ τ , X τ ) r 0 = r, λ 0 = λ, X 0 = e k .
(164) We note that if τ Ω is the stopping time that stops upon exiting the domain Ω c k when X = e k then for all = 1, ..., N :

P Ω (r, λ, e ) = E e -τ Ω 0 ru+lu+λudu χ(r τ Ω , λ τ Ω , X τ Ω ) r 0 = r, λ 0 = λ, X 0 = e .
Note that the stopping time τ Ω is finite a.e. and P Ω (•, •, e k ) is C 2 except possibly the negligible set ∪ N k=1 ∂Ω k . Thus P ≥ P Ω ; when Ω touches one of the axis r = 0 or λ = 0 the continuity with respect to Ω ensured by the boundary condition (156) shows that we still have P ≥ P Ω . In particular for Ω * we obtain P ≥ P Ω * ; all that remains to be proved is the reverse inequality i.e. P ≤ P Ω * .

To this end we use a similar technique as in Theorem 10.4.1 [59, Section 10.4 page 227] (see also [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] for similar considerations). First one can invoke the same arguments as in cited reference (cf. Appendix D for technicalities) and work as if P Ω * is C 2 (not only C 1 as the hypothesis ensures).

The Lemma 18.5 below shows that A R P Ω * ≤ 0 pointwise almost everywhere and is null on Ω * ,c k when X = e k . The Îto formula gives

d e -t 0 rs+ls+λsds P Ω * (r t , λ t , X t )) = e -t 0 rs+ls+λsds (A R P Ω * )(r t , λ t , X t ))dt +d(martingale) (165)
Taking averages and integrating from 0 to some stopping time τ it follows from A R P Ω * ≤ 0 that

P Ω * (r, λ, X) ≥ E e -τ 0 ru+lu+λudu P Ω * (r τ , λ τ , X τ ) r 0 = r, λ 0 = λ, X 0 = X ≥ E e -τ 0 ru+lu+λudu χ(r τ , λ τ , X τ ) r 0 = r, λ 0 = λ, X 0 = X .
Since this is true for any stopping time τ the conclusion follows.

Lemma. Under the hypothesis of the Theorem 24 the following inequality holds pointwise almost everywhere on R 2 + :

(A R P Ω * )(r, λ, X) ≤ 0, ∀r, λ > 0, ∀X. (166)
Proof. From (157) the conclusion is trivially verified for X = e k for any (r, λ) ∈ Ω * c k . The non-trivial part of this lemma comes from the fact that if for fixed k, r 1 > 0, λ 1 > 0

P Ω * (r, λ, e k ) = χ(r, λ, e k )
for any (r, λ) in some the neighbourhood of (r 1 , λ 1 ) this does not necessarily imply

(A R P Ω * )(r 1 , λ 1 , e k ) = (A R χ)(r 1 , λ 1 , e k )
because A R depends on other values P Ω * (r, λ, e j ) with j = k. Suppose now (r, λ) ∈ ∩ N j=1 Ω * j ; this means in particular that Ω * k = ∅ and from hypothesis (160) also Ω ξ+ k = ∅ and moreover ξ(r, λ, e k ) > K for any k = 1, ..., N ; thus χ(r, λ, e k ) = ξ(r, λ, e k ) -K for any k. Furthermore since (r, λ) ∈ ∩ N j=1 Ω * j we have P Ω * (r, λ, e k ) = χ(r, λ, e k ) = ξ(r, λ, e k ) -K for any k. Fix X = e k ; then

(A R P Ω * )(r, λ, e k ) = (A R χ)(r, λ, e k ) = (A R (ξ -K))(r, λ, e k ) = (A R ξ)(r, λ, e k ) -A R (K) = -(r + ρ 0 )K + (r + l k + λ)K = K(l k + λ -ρ 0 ) ≤ 0, (167)
the last inequality being true by hypothesis. A last situation is when λ ∈ Ω * k \ ∩ N j=1 Ω * j ; there P Ω * (r, λ, e k ) = χ(r, λ, e k ) but some terms P Ω * (r, λ, e j ) for j = k may differ from χ(r, λ, e j ). The computation is more technical in this case. This point is specific to the fact that the payoff χ itself has a complex structure and as such was not emphasized in previous works (e.g., [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF], etc.).

Recalling the properties of ξ one obtains using P Ω * (r, λ, e k ) = χ(r, λ, e k ):

(A R P Ω * )(r, λ, e k ) = (A k χ)(r, λ, e k ) -(r + l k + λ)χ(r, λ, e k ) + N j=1 a k,j P Ω * (r, λ, e j ) -χ(r, λ, e k ) = (A R χ)(r, λ, e k ) + N j=1 a k,j P Ω * (r, λ, e j ) -χ(r, λ, e j ) = (A R ξ)(r, λ, e k ) -A R (K) + N j=1
a k,j P Ω * (r, λ, e j ) -χ(r, λ, e j ) = -K(r

+ ρ 0 ) + (r + l k + λ)K + N j=1 a k,j P Ω * (r, λ, e j ) -χ(r, λ, e j ) ≤ 0, (168)
where for the last inequality we use hypothesis (163). Finally, since we proved that (A R P Ω * )(r, λ, X) ≤ 0 strongly except for some values depending on the frontiers of Ω * k and since P Ω * is of C 1 class we obtain the conclusion. Remark 15 Several remarks are in order at this point:

1. when N > 1 checking (163) does not involve any computation of derivatives and is straightforward.

2. as mentioned in the previous section, the Theorem is a verification result i.e., only gives sufficient conditions for a candidate to be the option price.

3. the candidate solution Ω * can be found either by maximizing the function Ω → P Ω (r 0 , λ 0 , X 0 ) with respect to all admissible Ω (which is difficult for 2-dimensional domains) or by solving a constraint optimization problem as seen below.

A minimization problem and the numerical algorithm

The Theorem 24 is a verification result. Its utility is to guarantee that a candidate Ω * is solution once such a candidate is found. But the Theorem does not say how to find Ω * . To this end we rewrite our problem in a different framework, that of a minimization problem based on a variational inequality as explained below. It is worth mentioning that variational inequalities are naturally associated to an American option but the non-standard payoff here does not allow to obtain information on the geometry of the exercise and continuation regions directly from classic approaches to such variational inequalities. We refer the reader to [START_REF] Kinderlehrer | An Introduction to Variational Inequalities and Their Applications[END_REF] for further information on the mathematical objects involved. The results of this Section are proved under the assumption that the Markov chain X t has a stationary distribution. This assumption is not restrictive in practice. In conjunction with the existence of a stationary distribution for each CIR process it allows to consider the joint stationary distribution of the dynamics (r t , λ t , X t ), whose density is denoted µ(r, λ, X). To ease notations when there is no ambiguity we write µ k or µ k (r, λ) instead of µ(r, λ, e k ). Note that since µ represents a probability density it is always (strictly) positive. Moreover, see Section 16, one can prove that µ k is C ∞ and all moments are finite.

Introduce for functions u, v : R

+ × R + × E → R (with u k := u(•,
•, e k ) and same for v) the notation:

u, v = N k=1 (R + ) 2 σ 2 λ,k 2 λ∂ λ u k ∂ λ v k + σ 2 r,k 2 r∂ r u k ∂ r v k + ρσ r,k σ λ,k √ rλ ∂ r u k ∂ λ v k + ∂ r v k ∂ λ u k 2 + u k v k (r + λ + l k ) µ k drdλ + ∞ 0 γ λ,k θ λ,k - σ 2 λ,k 2 u k (r, 0)v k (r, 0) 2 µ k (r, 0)dr + ∞ 0 γ r,k θ r,k - σ 2 r,k 2
u k (0, λ)v k (0, λ) 2 µ k (0, λ)dλ + + 1≤j<k≤N (R + ) 2 (a j,k µ j + a k,j µ k )(u k -u j )(v k -v j ) 2 drdλ, (169)
and denote by H the space:

H = {u : R + × R + × E → R| u, u < ∞}. (170)
Define also for smooth functions the bilinear form

a (u, v) = N k=1 (R + ) 2 (-A R (u))(r, λ, e k )v(r, λ, e k )µ k drdλ. (171)
Theorem 16 Suppose that the Markov chain with transition matrix A admits a stationary distribution. Then 1. The space H is a Hilbert space with scalar product •, • . We will denote by • its norm.

2. The form a admits a unique continuous extension to H ×H (denoted still a ), χ ∈ H and the problem

min{a (u, u -χ)|u ∈ H , u ≥ χ, a (u, v) ≥ 0, ∀v ∈ H , v ≥ 0}, (172)
is well posed and admits a unique solution U .

3.

Consider Ω * that satisfies the hypothesis of the Theorem 24. Then P = U .

Proof.

1/ We first prove that •, • is a scalar product. The property to prove is the strict positivity. But since |ρ| ≤ 1 by Cauchy-Schwartz:

(R + ) 2 σ 2 λ,k 2 λ(∂ λ u k ) 2 + σ 2 r,k 2 r(∂ r u k ) 2 + ρσ r,k σ λ,k √ rλ∂ r u k ∂ λ u k drdλ ≥ 0.
(173) Under hypotheses (138)-( 139) the other terms are also positive; moreover the sum of all terms is strictly positive as soon as the function u is non-null.

2/ We prove that for regular enough functions

a (u, v) = u, v + b (u, v), (174)
where b :

H × H → R is a continuous, antisymmetric (i.e., b (u, v) + b (v, u) = 0) bilinear form.
To this end one has to integrate by parts all terms appearing in the definition of the form a . We take for instance the correlation term and compute for regular functions f, g, h with exponential decay at infinity (see Section 15 for details):

(R + ) 2 ∂ rλ f g √ rλhdrdλ = - (R + ) 2 ∂ λ f ∂ r √ rλhdrdλ + (R + ) 2 f g∂ λr ( √ rλh) 2 drdλ + (R + ) 2 f ∂ λ g -g∂ λ f 2 ∂ r ( √ rλh))drdλ. (175)
The first term enters in the definition of the scalar product and is symmetric; last term is antisymmetric. The middle term will be seen to simplify latter on. This identity will be used for f = u k , g = v k , h = µ k for all k. Similar identities are found for terms involving derivatives. We obtain by summation that a (u, v) is the sum of : u, v except the last term, -an antisymmetric continuous bilinear form -the quantity:

N k=1 (R + ) 2 u k v k 2 (-A * k (µ k ))-N j=1 a k,j (u j -u k )v k µ k drdλ. Here A *
k is the adjoin of A * k and acts on regular functions w by:

A * k (w) = -∂ λ (γ λ,k (θ λ,k -λ)w) + σ 2 λ,k 2 ∂ λλ (λw) -∂ r (γ r,k (θ r,k -r)w) + σ 2 r,k 2 ∂ rr (rw) +ρσ λ,k σ r,k ∂ rλ ( √ rλw). (176)
norm of the space, the convergence is strong L 2 loc . In particular from u n ≥ χ it follows U ≥ χ.

Consider now v ∈ H with v ≥ 0. Then from 0 ≤ a (u n , v) and (by weak convergence) lim n→∞ a (u n , v) = a (U , v) one concludes that a (U , v) ≥ 0 i.e., U is admissible.

Note also that weak convergence implies

a (U , U ) = U 2 ≤ lim inf n→∞ u n 2 = lim inf n→∞ a (u n , u n ). (180)
Since

lim n→∞ a (u n , χ) = a (U , χ) one obtains a (U , U -χ) ≤ lim inf n→∞ a (u n , u n -χ), (181)
thus U is a minimizer and U ∈ H . Suppose now that there exist two minimizers U 1 and U 2 . Denote

m = a (U 1 , U 1 -χ) = a (U 2 , U 2 -χ). (182)
Then one notes that U 1 +U 2 2 is an admissible point. Moreover, from minimality

m ≤ a ( U 1 + U 2 2 , U 1 + U 2 2 -χ) = U 1 + U 2 2 2 -a ( U 1 + U 2 2 , χ) = U 1 + U 2 2 2 - U 1 2 + U 2 2 2 + m = m - U 1 -U 2 2 2 , (183)
which implies U 1 = U 2 .
3/ We proved that -A R P ≥ 0 (except possibly a null measure set). Thus when one multiplies by any positive, sufficiently smooth, function v one obtains after integration

N k=1 (R + ) 2 ×{e k } (-A R P )vµ k ≥ 0, (184)
i.e., a (P, v) ≥ 0. By density the result will be true for any positive v ∈ H . Recalling that P ≥ χ one obtains that P is an admissible function for the minimization (172). Moreover a (P, P -χ) = 0 ≤ a (u, u -χ) for any admissible u (take v = u -χ), hence the conclusion.

Remark 17

1. The result above is constructive in the sense that the numerical implementation is more straightforward than that directly related to the Theorem 24; the solution can be obtained by solving a linear constrained quadratic optimization problem with strictly positive Hessian that is obtained from suitable discretization of the bi-linear form a . However the reader should not be mislead by the conceptually "simple" framework of a quadratic optimization problem under convex constraints: convex optimization problems may be numerically very time consuming when the number of constraints is high, as is the situation here. Numerical algorithms that address this problem are however available, cf. [START_REF] Bonnans | Numerical optimization. Universitext[END_REF].

2. Once a candidate is found it has to satisfy all hypothesis of Theorem 24, in particular the hypothesis (162). Note that since the candidate is C 2 on domains Ω * k and Ω * c k only the conditions on the frontier Γ * k is to be satisfied. The continuity is straightforward to check. For the continuity of the derivatives one notes that only the continuity of the normal derivative (the normal is with respect to the frontier Γ * k ) is to be verified: for all other directions the derivative will be continuous because is the trace on Γ * k of the derivative of a C 2 function.

Numerical Application

Several partial differential equations involving operators A R and A * k are to be solved. We use two different numerical implementations and both give similar results.

One implementation uses a finite difference method (written in M AT LAB c ) based on a grid with the time step ∆r and space step ∆λ and look for an approximation P n, ,k of P Ω * (n∆r, ∆λ, e k ). The domain is truncated at λ max and r max .

The first and second derivatives are approximated by (centered) finite difference formula. We obtain for instance the discretization of A R (P ): Since the PDEs are degenerate at the boundaries r = 0, ∞, λ = 0, ∞ there is no need to impose boundary conditions at these points. In practice, in order to obtain as many equations as unknowns, for the last point before boundary, e.g., P 1, ,k we use de-centred finite differences.

γ r,k (θ
A second implementation used the FreeFem++ software (see [START_REF] Hecht | FreeFem++[END_REF] for details). This code is very efficient and implements a finite element method. Freefem++ was used to discretize the operators and obtain the matrices in the Galerkin basis. Then the optimization was performed with Octave (see [START_REF] Eaton | Gnu Octave Version 3. 0. 1 Manual: A High-Level Interactive Language for Numerical Computations[END_REF]).

In this numerical application, λ max = 400bps, r max = 5%, ∆λ = 10bps and ∆r = 10bps. Recall that a basis point, denoted "1 bps" equals 10 -4 .

Application 1 : 1 regime

We consider a perpetual loan with a nominal K = 1 and one regime (N = 1). We omit in the following the variable X assigned to the regime. The borrower default intensity λ t follows a CIR process with parameters: initial intensity λ 0 = 100bps, volatility σ λ = 0.1, average intensity θ λ = 220bps, reversion coefficient γ λ = 0.1. On the interbank market, the CIR process of the LIBOR has the following parameters: initial LIBOR r 0 = 4%, volatility σ r = 0.1, average intensity θ r = 4.6%, reversion coefficient γ r = 0.8. We assume a unique and constant liquidity cost l 1 = 50bps.

In order to find the initial contractual margin we use equation ( 145) and find ρ 0 = 196bps. Therefore, we can represent ξ(r, λ) according to the current intensity λ and LIBOR r, see Figure 21. We illustrate the dependence of ξ(r, λ) around (r 0 , λ 0 ) separately with respect to both variables r, λ in the Figure 20. Note that ξ(r 0 , λ) is very sensitive to the borrower's credit quality and it decreases when λ rises; on the contrary ξ(r, λ 0 ) exhibits a low sensitivity to LIBOR variations.

The price P and the optimal frontier Γ * are obtained with the algorithm in Section 12 and are validated by checking the hypothesis of the Theorem 24; the optimal frontier defines the exercise region (below the curve) and the continuation region (above the curve), see Figure 22. At origination, the present value of cash flows is at par, so ξ(r 0 , λ 0 ) = 1. The prepayment option price is P (r 0 , λ 0 ) = 0.0347 = 3.61% • K, see Figure 23. We illustrate the dependence of the option P (r, λ) with respect to both variables (r, λ) around (r 0 , λ 0 ) in the Figure 24. Note that P (r 0 , λ) is very sensitive to the borrower's credit quality λ and it decreases when λ rises. On the contrary P (r, λ 0 ) exhibits a low sensitivity with respect to LIBOR variations.

Therefore the loan value equals ξ(r 0 , λ 0 )-P (r 0 , λ 0 ) = 0, 9653. If the bank decides to include the prepayment option in the initial contractual margin ρ 0 (cf. Remark 22) then ρ 0 = 346bps. Note that ρ 0 is significantly higher than ρ 0 .

Figure 22: The optimal boundary function Γ * as function of the LIBOR r for the inputs in Section 13.1. Two regions appear : the continuation region (above the curve) and the exercise region (below the curve).

Application 2 : 2 regimes

Consider a loan with a nominal K = 1 in an environment with two economic states: state e 1 corresponds to economic expansion and state e 2 to a recession. The borrower default intensity λ t follows a CIR process with different parameters according to the economic state: initial intensity λ 0 = 212bps, volatility (σ λ,1 , σ λ,2 ) = (0.1, 0.2), average intensity (θ λ,1 , θ λ,2 ) = (220bps, 1680bps), reversion coefficient (γ λ,1 , γ λ,2 ) = (0.1, 0.2). The default intensity process reflects a higher credit risk in state e 2 .

The CIR process of the LIBOR is defined with the following parameters: initial LIBOR r 0 = 4%, volatility (σ r,1 , σ r,2 ) = (0.1, 0.01), average intensity (θ r,1 , θ r,2 ) = (4.6%, 0.3%), reversion coefficient (γ r,1 , γ r,2 ) = (0.8, 0.3). We take the correlation ρ to be null. The LIBOR is linked to the Central Bank rates: during a state of economic expansion, the Central Bank rises the rates to avoid inflation and during a recession, the Central Bank decreases the rates to help economic growth. Of course the mathematical model can accommodate any other Central Bank policy.

We assume a liquidity cost defined by a Markov chain of two states l 1 = 0bps and l 2 = 290bps. For N = 2 the rate A matrix is completely defined by α 1,2 = 1/5, α 2,1 = 1/5.

In order to find the initial contractual margin we use equation ( 145) and find ρ 0 = 851bps in the state e 2 . The contractual margin takes into account the credit risk (default intensity) and the liquidity cost. In this situation ξ(r, λ, e 1 ) is higher than ξ(r, λ, e 2 ) according to the degradation of the credit quality, through the intensity process parameters, and the degradation of the access to money market involving an increase of the funding costs l k , see Figures 25. The optimal frontiers Γ * 1 and Γ * 2 are obtained with the algorithm in Section 12 and are validated by checking the hypothesis of the Theorem 24; we obtain (r 0 , 340bps) ∈ Γ * 1 , (r 0 , 0) ∈ Γ * 2 , see Figure 26. Both frontiers delimit the exercise region (below the curve) and the continuation region (above the curve). In state e 2 , the optimal frontier is at 0 for all r, because in this particular case it is never optimal to prepay.

We illustrate the dependence of the option P (r, λ, X 0 ) with respect to both variables (r, λ) in the Figures 27. P (r, λ, e 1 ) is higher than P (r, λ, e 2 ).

In the state e 2 , the present value of cash flows is at par, so ξ(r 0 , λ 0 , X 0 ) = 1. The prepayment option price is P (r 0 , λ 0 , X 0 ) = 0.1033. Therefore the loan value equals ξ(r 0 , λ 0 , X 0 ) -P (r 0 , λ 0 , X 0 ) = 0.8967. If the bank decides λ λ Figure 25: ξ(r, λ, X) as a function of the intensity and the LIBOR for the inputs in Section 13.2. Left: regime X = e 1 ; Right: regime X = e 2 . ξ(r, λ, e 1 ) is higher than ξ(r, λ, e 2 ) according to the degradation of the credit quality (λ parameters) and the degradation of the access to money market (funding issues). It converges to 0 at infinity. in regime X = e 2 (asterisk line) as function of the LIBOR r for the inputs in Section 13.2. Recall that the continuation region is above the boundary and the exercise region below the boundary. For regime e 1 two regions appear : the continuation region and the exercise region while for regime e 2 only the continuation region is present. The borrower will only prepay in regime e 1 after the crisis is over.

to include the prepayment option in the initial contractual margin ρ 0 (cf. Remark 22) the loan value will equal par for ρ 0 = 1199bps in the state e 2 , significantly higher than ρ 0 .

Remark 18

In all examples the sensitivity with respect to r is less critical than the sensitivity with respect to λ. 13.3 Application 3 : N = 2 regimes with a non-zero correlation ρ

Consider a loan with the same parameters as in Section 13.2 and assume a non-zero correlation between the dynamics of the intensity and the instantaneous interest rate.

The initial contractual margin is found to be ρ 0 = 854bps for X 0 = e 2 . Even with a substantial ρ = -50% correlation, there is only a 4bps increase with respect to example in Section 13.2 (that had null correlation). Likewise, the optimal boundaries are the same in both applications, as illustrated in Figure 28. The prepayment option price is P (r 0 , λ 0 , X 0 ) = 0.1026. Therefore the loan value equals ξ(r 0 , λ 0 , X 0 ) -P (r 0 , λ 0 , X 0 ) = 0.8974.

Application 4 : impact of the end of a recession

In the Section 13.2 we considered that the loan originates in a state of recession but the bank uses a multi-regime model. We consider in this section a simpler case with a unique regime (N = 1) which is a recession regime. All parameters are the parameters of Section 13.2 for X = e 2 .

The initial contractual margin is found to be ρ 0 = 1, 204bps which is a sharp increase with respect to 851bps found in Section 13.2. On the other hand the prepayment option price is lower: P (r 0 , λ 0 ) = 0.01855 and the loan value equals ξ(r 0 , λ 0 ) -P (r 0 , λ 0 ) = 0.98145.

Numerical results, not shown here, indicate that the optimal frontier is not null and the domain is divided in a continuation region and an exercise region, as illustrated in Figure 29.

Discussion and interpretation of the numerical results

Several conclusions can be drawn from the examples above. First of all, the prepayment option has a non-negligible impact on the loan value and as such it should be taken into account and its risk assessed.

Secondly, the presence of a multi-regime dynamics can change dramatically the exercise and continuation regions: while a single-regime recession (Section 13.4) will display a exercise region, a two-regime model (Section 13.2) displays an exercise region only in the "normal" regime and none during recession time. This is completely consistent with actual banking practice : clients seldom prepay during recessions. Thus the conclusions of the single-regime model are misleading regarding the (optimal) behaviour of the clients.

On the contrary, it is probable that some clients will exercise their prepayment option when the economy recovers. The model proposes a quantitative framework to explain when this may happen as a function of the credit spread λ t of the client and of the short rate r t .

Finally, the value r t and the correlation ρ between the CIR dynamics of r t and λ t play a secondary role in the qualitative properties of the prepayment option.

14 Details of the computations in equation (175)

We integrate by parts:

(R + ) 2 ∂ rλ f g √ rλhdrdλ = R + ∂ λ f g √ rλh r=∞ r=0 dλ - (R + ) 2 ∂ λ f ∂ r (g √ rλh)drdλ = 0 - (R + ) 2 ∂ λ f ∂ r g √ rλhdrdλ + ∂ λ f g∂ r ( √ rλh)drdλ = - (R + ) 2 ∂ λ f ∂ r g √ rλhdrdλ - R + f g∂ r ( √ rλh) λ=∞ λ=0 dr + (R + ) 2 f ∂ λ (g∂ r ( √ rλh))drdλ = - (R + ) 2 ∂ λ f ∂ r g √ rλhdrdλ + (R + ) 2 f g∂ λr ( √ rλh)drdλ + (R + ) 2 f ∂ λ g∂ r ( √ rλh))drdλ. (185)
The first two terms are already in convenient form. For the last one we write:

(R + ) 2 f ∂ λ g∂ r ( √ rλh))drdλ = R + f g∂ r ( √ rλh) λ=∞ λ=0 dr - (R + ) 2 g∂ λ (f ∂ r ( √ rλh)))drdλ = 0 - (R + ) 2 g∂ λ f ∂ r ( √ rλh))drdλ - (R + ) 2 gf ∂ λr ( √ rλh)drdλ. (186)
One adds now the term (R + ) 2 f ∂ λ g∂ r ( √ rλh))drdλ to each member of this identity to write:

(R + ) 2 f ∂ λ g∂ r ( √ rλh))drdλ = (R + ) 2 f ∂ λ g -g∂ λ f 2 ∂ r ( √ rλh))drdλ - (R + ) 2 f g∂ λr ( √ rλh) 2 drdλ. ( 187
)
We obtain thus (175). of µ k is finite i.e., N k=1 (R + ) 2 rµ k drdλ < ∞ (see Section 16); we conclude that ξ ∈ H .

Regularity for χ

Note that χ = 1 ξ>K . Moreover the derivatives of ξ and χ coincide on the set {ξ > K} and elsewhere the derivatives are zero. Finally, on {ξ > K}, ξ > χ ≥ 0. Thus χ, χ ≤ ξ, ξ < ∞ thus χ ∈ H .

Regularity for P Ω *

From (164) one obtains that

P (r, λ, X) ≤ K(1 + ρ 0 ), ∀r, λ, X. (193)
Note that P Ω * = P Ω * 1 P Ω * >χ + P Ω * 1 P Ω * =χ and recall that on {P Ω * > χ} we have A R P Ω * = 0; thus a (P Ω * , P Ω * ) = a (P Ω * 1 P Ω * >χ + P Ω * 1 P Ω * =χ , P Ω * ) = 0 + a (P Ω * 1 P Ω * =χ , P Ω * ) = a (χ1 P Ω * =χ , χ1 P Ω * =χ ) = χ1 P Ω * =χ , χ1 P Ω * =χ ≤ χ, χ < ∞.

(

) 194
Hence P Ω * ∈ H .

16 Some properties of µ Similar techniques as in previous sections allow to prove that µ k is C ∞ . We will only prove that the first order moment with respect to r is finite, all others follow the same lines of proof. Recall that since µ is a stationary distribution, by ergodicity :

N k=1 (R + ) 2 rµ k drdλ = lim T →∞ T 0 E(r t )dt T . ( 195
)
The equation is true irrespective of the starting point r 0 , λ 0 , X 0 . Denote m t = E(r t ). An application of the Îto formula gives that

d dt m t = Eγ r (X t )(θ r (X t ) -r t ), m 0 = r 0 . (196)
Of course m t ≥ 0, ∀t. The process X t is piecewise constant. In particular θ r (X t ) takes a finite number of values, let us denote M -= min k θ r (e k )γ r (e k ), M + = max k θ r (e k )γ r (e k ), γ r,max = max k γ r (e k ), γ r,min = min k γ r (e k ). Then for all t :

∀t ≥ 0 : d dt m t ∈ γ r,max M - γ r,max -m t , γ r,min M + γ r,min -m t , m 0 = r 0 .
(197) Then the distance from m t to the interval M - γr,max , M + γ r,min is decreasing hence m t is bounded by some constant C. Therefore lim T →∞ T 0 E(rt)dt T ≤ C < ∞ which gives the conclusion.

Introduction

A loan contract issued by a bank for its corporate clients is a financial agreement that often comes with more flexibility than a retail loan contract. These options are designed to meet clients' expectations and can include e.g., a prepayment option which entitles the client, if he so desires, to pay all or a fraction of its loan earlier than the maturity. Although the technical part is different, the principle of such an option is very close to the embedded option of a callable bond. When market interest rates are low the issuer of the bond can buy back his debt at a defined price before the bond reaches its maturity. It allows the issuer to refinance its debt at a cheaper rate.

In order to decide whether the exercise of the option is worthwhile the borrower compares the remaining payments (discounted at the interest rate he can obtain at that time) with the nominal value (outstanding amount of the loan) . If the remaining payments exceed the nominal value then it is optimal for the borrower to refinance his debt at a lower rate.

When the interest rates are not constant or borrower is subject to default, the computation of the actualization is less straightforward. It starts with considering all remaining payments discounted and weighted with the suitable probability of default, including the final payment of the principal if applicable. In event of default, we define the recovery rate δ as the percentage of nominal value K repaid. The present value of the remaining payments will be called "P V RP " and denoted ξ. To continue with evaluating the prepayment option, the P V RP is compared with the nominal value: if the P V RP is larger than the nominal value then the borrower should prepay, otherwise not. Recall that at the initial time, the payments correspond to the sum of the interest rate and the contractual margin ρ 0 , which is precisely making the two quantities equal.

Note that in order to compute the price of the embedded prepayment option the lender also has to compute the P V RP as it will be seen below.

For a bank, the prepayment option is essentially a reinvestment risk i.e., the risk that the borrower decides to repay earlier his/her loan and that the bank can not reinvest his/her excess of cash in a new loan with same characteristics. So the longest the maturity of the loan, the riskier the prepayment option. Therefore, it is worthwhile to study long-term loans, some that are set for more than three years and can run for more than twenty years in structured finance. The valuation problem of the prepayment option can be modelled as an embedded compound American option on a risky debt owned by the borrower. As Monte-Carlo simulations are slow to converge to assess accurately the continuation value of the option during the life of the loan and that the binomial tree techniques are time-consuming for long-term loans (cf. works by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]), we decided to focus, in this paper, on PDE version instead of binomial trees or Monte Carlo techniques.

When valuing financial products with medium to long maturity the robustness with respect to shocks and other exogenous variabilities is important. Among problems that have to be treated is the liquidity and its variability. Liquidity is a crucial ingredient towards the systemic stability of the financial sphere and can cause banks' failures if systemic liquidity squeezes appear. Historical data back to the Asian crisis of 1997; the Russian financial crisis of 1998; the defaults of hedge funds and investment firms like LTCM, Enron, Worldcom and Lehman Brothers defaults, sovereign debts crisis of 2010-11 and so on prove that banks hold significant liquidity risk in their balance sheets. Even if liquidity problems have a very low probability to occur, a liquidity crisis can have a severe impact on a bank's funding costs, its market access (reputation risk) and short-term funding capabilities.

Probably the most characteristic of the liquidity is that it oscillates between distinct regimes following the state of the economic environment. Between two crisis, investors are confident and banks find it easier to launch their long term refinancing programs through regular bonds issuances. Thus the liquidity market is stable. Contrariwise, during crisis, liquidity becomes scarce, pushing the liquidity curve to very high levels which can only decrease if confidence returns to the market. The transition between these two distinct behaviours is rarely smooth and often sudden.

In order to model the presence of distinct liquidity behaviours we will simulate the liquidity cost by a continuous time discrete state Markov chain that can have a finite set of possible values, one for each liquidity regime.

From a technical point of view this paper addresses a non-standard situation: although the goal is to value an American option the payoff of the option is highly non-standard (is dependent on the P V RP ) and is close to a compound option in spirit (although not exactly so). As a consequence the characterization of the exercise region is not at all standard and technical conditions have to be met. Furthermore our focus here is on a specific type of dynamics (of CIR type) with even more specific interest on the situation when several regimes are present.

The crucial variable throughout the paper is the borrower credit risk defined by his/her default intensity (called in the following simply "intensity"); it follows a CIR stochastic process and the liquidity cost of the bank, defined as the cost of the lender to access the cash on the market, has several distinct regimes that we model by a Markov chain. We prove the pricing formulas and theoretically support an algorithm to identify the boundary of the exercise region; final numerical examples close the paper.

The plan of the paper is as follows: we discuss in Section 17.1 related works; then we start in Section 18.1 the mathematical description of the model followed in Sections 18.2 and 18.3 by some technical properties of the P V RP . Next the Section 18.4 explains the term structure of the liquidity in this model. The theoretical result concerning the price of the prepayment option is given in Section 18.5 and the numerical results in Section 19.

Related literature

There exist few articles (e.g., works by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF]) on the corporate loan prepayment option but a related topic, the prepayment option of a fixed-rate mortgage loan, has been covered in several papers by J.E. Hilliard and J.B. Kau [START_REF] Hillard | Valuing prepayment and default in a fixed-rate mortgage: A bivariate binomial options pricing technique[END_REF] and more recent works by Chen et al. [START_REF] Chen | The value of mortgage prepayment and default options[END_REF]. To approximate the PDE satisfied by the prepayment option, they define two state variables (interest rate and house price). Their approach is based on a bivariate binomial option pricing technique with a stochastic interest rate and a stochastic house value.

Another contribution by D. Cossin et al. [START_REF]Pricing prepayment option in C & I loans at origination[END_REF] applies the binomial tree technique (but of course it is time-consuming for long-term loans due to the nature of binomial trees) to corporate loans. They consider a prepayment option with a 1 year loan with a quarterly step but it is difficult to have an accurate assessment of the option price for a 10 years loan.

There also exist mortgage prepayment decision models based on Poisson regression approach for mortgage loans. See, for example, E.S. Schwartz and W.N. Torous [START_REF] Schwartz | Mortgage prepayment and default decisions: A Poisson regression approach[END_REF]. Unfortunately, the volume and history of data are very weak in the corporate loan market.

Due to the form of their approach, these papers did not have to consider the geometry of the exercise region because it is explicitly given by the numerical algorithm. This is not the case for us and we have to take it into account when addressing the optimality of the solution. Furthermore, to the best of our knowledge, none of these approaches explored the circumstance when several regimes exist.

The analysis of Markov-modulated regimes has been investigated in the literature when the underlying(s) follow the Black& Scholes dynamics with drift and volatility having Markov jumps; several works are relevant in this area: Guo and Zhang [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] have derived the closed-form solutions for vanilla American put; Guo analyses in [START_REF] Guo | An explicit solution to an optimal stopping problem with regime switching[END_REF] Russian (i.e., perpetual look-back) options and is able to derive explicit solutions for the optimal stopping time; Mamon and Rodrigo [START_REF] Mamon | Explicit solutions to European options in a regime-switching economy[END_REF] find explicit solutions to vanilla European options. Buffington and Elliott [START_REF] Buffington | American options with regime switching[END_REF] study European and American options and obtain equations for the price. A distinct approach (Hopf factorization) is used by Jobert and Rogers [START_REF] Jobert | Option pricing with Markov-modulated dynamics[END_REF] to derive very good approximations of the option prices for, among others, American puts. Other contributions include [START_REF] Yao | A regime-switching model for European options[END_REF][START_REF] Tak | Pricing currency options under two-factor Markov-modulated stochastic volatility models[END_REF] etc. Works involving Markov switched regimes and CIR dynamics appears in [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] where the bond valuation problem is considered (but not in the form of an American option; their approach will be relevant to the computation of the payoff of our American option although in their model only the mean reverting level is subject to Markov jumps) and in [START_REF] Zhou | An accessible implementation of interest rate models with markov-switching[END_REF] where the term structure of the interest rates is analysed.

On the other hand numerical methods are proposed in [START_REF] Huang | Methods for pricing American options under regime switching[END_REF] where it is found that a fixed point policy iteration coupled with a direct control formulation seems to perform best.

The prepayment option has been considered in a perpetual setting in the previous part. This paper is specific in that it addresses the finite horizon case, more close to the practice. We also discuss the term structure of liquidity costs which is not relevant for the perpetual setting. Also, the numerical search for the exercise frontier is much easier in the time-independent setting where one point per regime is to be found (as opposed to here a curve for any regime).

Finally, we refer to [START_REF] Jaillet | Variational inequalities and the pricing of American options[END_REF] for theoretical results concerning the pricing of American options in general.

18 Prepayment option: the time dependency of the exercise region

Default intensity and theoretical regime switching framework

The prepayment option is an option on the credit risk, intensity and the liquidity cost. The liquidity cost is defined as the specific cost of a bank to access the cash on the market. This cost will be modelled with a switching regime with a Markov chain of finite states of the economy. We assume an interbank offered rate IBOR r to be constant. Therefore, the assessment of the loan value and its prepayment option is a N -dimensional problem. The intensity is still defined by a Cox-Ingersoll-Ross process (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Alfonsi | On the discretization schemes for the CIR (and Bessel squared) processes[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF] for theoretical and numerical aspects of CIR processes and the situations where the CIR process has been used in finance):

dλ t = γ(θ -λ t )dt + σ λ t dW t , λ 0 = λ 0 . (198)
It is known that if 2γθ ≥ σ 2 then CIR process ensure an intensity strictly positive. Fortunately, as it will be seen in the following, the PVRP is given by an analytic formula.

We will denote by A the characteristic operator (cf. [59, Chapter 7.5]) of the CIR process i.e. the operator that acts on any C 2 class function v by

(Av)(t, λ) = ∂ t v(t, λ) + γ(θ -λ)∂ λ v(t, λ) + 1 2 σ 2 λ∂ λλ v(t, λ). (199)
We assume the economic state of the market is described by a finite state Markov chain X = {X t , t ≥ 0}. The state space X can be taken to be, without loss of generality, the set of unit vectors E = {e 1 , e 2 , ..., e N }, e i = (0, ..., 0, 1, 0, ..., 0) T ∈ R N . Here T is the transposition operator.

Assuming the process X t is homogeneous in time and has a rate matrix A, then if p

t = E[X t ] ∈ R N , dp t dt = Ap t (200)
and,

X t = X 0 + t 0 AX u du + M t , (201)
where M = {M t , t ≥ 0} is a martingale with respect to the filtration generated by X. In differential form

dX t = AX t dt + dM t , X 0 = X 0 . (202)
We assume the instantaneous liquidity cost of the bank depends on the state X of the economy, so that l

t = l, X t (203)
Denote by a k,j the entry on the line k and the column j of the N × N matrix A with a k,j ≥ 0 for j = k and N j=1 a k,j = 0 for any k.

Analytical formulas for the PVRP

Assume a loan has a fixed coupon defined by the interest rate r and an initial contractual margin ρ 0 calculated at the inception for a par value of the loan. Let ξ(t, λ, X) be, the present value of the remaining payments at time t of a corporate loan where: λ is the intensity at time t; T is the contractual maturity; K is the nominal amount; δ is the recovery rate and X is the state of the economy at time t. The K, δ and T are fixed, we will omit them from all subsequent notations. The loan value LV (t, λ, X) is still equal to the present value of the remaining payments ξ(t, λ, X), minus the prepayment option value P (t, λ, X). LV (t, λ, X) = ξ(t, λ, X) -P (t, λ, X)

The PVRP ξ is the present value of the cash flows discounted at the risky rate, where the risky rate at time t is the constant risk-free rate r plus the liquidity cost l t and the intensity λ t . Here, we describe the cash flows in a term loan: the continuous coupon between t and t+∆t, K(r+ρ 0 )∆t+O(∆t); the nominal K reimbursed at the end if no default occurred and otherwise the portion of nominal recovered δ • K. It is defined by:

ξ(t, λ, X) := E T t (K (r + ρ 0 ) + δ • Kλ t) e -t t r+lu+λudu d t + Ke -T t r+lu+λudu λ t = λ, X t = X (205)
We consider that there is no correlation between the credit risk, i.e., the intensity λ t , of the borrower and the cost to access the cash on the market, i.e. the liquidity cost l t , of the lender. Therefore, we have,

ξ(t, λ, X) = K (r + ρ 0 ) T t e -r( t-t) E e -t t λudu λ t = λ E e -t t ludu X t = X d t +δ • K T t e -r( t-t) E λ te -t t λudu λ t = λ E e -t t ludu X t = X d t +Ke -r(T -t) E e -T t λudu λ t = λ E e -T t ludu X t = X (206)
Remark 19 The crucial information here is that the coefficients γ, θ, σ of the CIR process are not depending on the regime X thus we can separate the CIR dynamics and the Markov dynamics at this level. A different approach can extend this result by using the properties of the PVRP as explained in the next section.

For a CIR stochastic process, we obtain (see [START_REF] Cox | A theory of the term structure of interest rates[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF]),

ξ(t, λ, X) = K (r + ρ 0 ) T t e -r( t-t) B(t, t, λ)E e -t t ludu X t = X d t -δ • K T t e -r( t-t) ∂ tB(t, t, λ)E e -t t ludu X t = X d t +Ke -r(T -t) B(t, T, λ)E e -T t ludu X t = X (207)
where for general t, t we use the notation:

B(t, t, λ) = E e -t t λudu λ t = λ . (208)
Note that B(t, t, λ) is a familiar quantity: it is formally the same formula as the price of a zero-coupon where the interest rates follow a CIR dynamics.

Of course here the interest rate is constant and the intensity is following a CIR dynamics nevertheless the same formula applies for general t, t:

B(t, t, λ) = α(t, t)e -β(t, t)λ , (209)
with,

α(t, t) = 2h e (γ+h) t-t 2 2h + (γ + h)(e ( t-t)h -1) 2γθ σ 2 β(t, t) = 2(e ( t-t)h -1) 2h + (γ + h)(e ( t-t)h -1)
, where h = γ 2 + 2σ 2 . (210)

Obviously B(t, t, λ) is monotonic with respect to λ.

In order to compute,

E e -t t ludu X t = X , (211)
and as the Markov chain is homogeneous in time,

E e -t 0 ludu X 0 =< X, e k > = E e -t t ludu X t =< X, e k > (212)
let f k (t) be defined by:

f k (t) = E e -t 0 ludu X 0 =< X, e k > . (213)
Therefore we obtain,

ξ(t, λ, e k ) = K (r + ρ 0 ) T t e -r( t-t) B(t, t, λ)f k ( t -t)d t -δ • K T t e -r( t-t) ∂ t B(t, t, λ)f k ( t -t)d t +Ke -r(T -t) B(t, T, λ)f k (T -t) (214)
Let τ , the time of the first jump from X 0 =< X, e k > to some other state. We know (cf. Lando [START_REF] Lando | Credit Risk Modeling[END_REF] paragraph 7.7 p 211) that τ is a random variable following an exponential distribution of parameter α k with,

α k = j =k a k,j (215)
We also know that conditional to the fact that a jump has occurred at time τ the probability that the jump is from state e k to state e j is p k,j , where

p k,j = a k,j α k (216) Thus, f k (t) = P(τ > t)e -l k t + P(τ ≤ t)e -l k τ j =k P(l τ = l j )E e -t τ ludu X τ =< X, e j > = e -(l k +α k )t + α k t 0 e -(l k +α k )τ j =k p k,j f j (t -τ )dτ 129
Then,

e (l k +α k )t f k (t) = 1 + α k t 0 e (l k +α k )(t-τ ) j =k p k,j f j (t -τ )dτ = 1 + α k t 0 e (l k +α k )s j =k p k,j f j (s)ds
By differentiation with respect to t:

d dt e (l k +α k )t f k (t) = α k e (l k +α k )t j =k p k,j f j (t) Then df k (t) dt + (l k + α k )f k (t) = α k j =k p k,j f j (t) Thus, df k (t) dt = j =k α k p k,j f j (t) -(l k + α k )f k (t) (217)
Denote

F (t) = (f 1 (t), f 2 (t), ..., f N (t)) T and introduce the N × N matrix B, B i,j = α i p i,j if i = j -(α i + l i ) if i = j (218)
From equation (217) we obtain,

dF (t) dt = BF (t) thus F (t) = e Bt F (0) (219)
with the initial condition,

F (0) = f k (0) N k=1 = (1, 1, ..., 1) T ∈ R N . (220)
We have therefore analytical formulas for the PVRP ξ(t, λ, X). We refer the reader to [START_REF] Elliott | On Markov-modulated exponentialaffine bond price formulae[END_REF] for similar considerations on a related CIR switched dynamics.

Remark 20 When all liquidity parameters l k are equal (to some quantity l) then B = A -l • Id and then we obtain (after some computations) that f k (t) = e -lt thus the payoff is equal to that of a one-regime dynamics with interest rate r + l, which is consistent with intuitive image we may have. Another limiting case is when the switching is very fast.

The margin ρ 0 is set to satisfy the equilibrium equation

ξ(0, λ 0 , X 0 ) = K. (221)
which can be interpreted as the fact that the present value of the cash flows (according to the probability of survival) is equal to the nominal K. Therefore according to (214) and e k 0 such that X 0 =< X, e k 0 >,

ρ 0 = 1 + δ T t e -r( t-t) ∂ tB(t, t, λ)f k 0 ( t -t)d t -e -r(T -t) B(t, T, λ)f k 0 (T -t) T t e -r( t-t) B(t, t, λ)f k 0 ( t -t)d t -r. (222) Remark 21 λ T is not defined because ∀λ ∈ R + , ξ(T, λ, X 0 ) = K (223)
Note that we assume no additional commercial margin.

Remark 22 If an additional commercial margin µ 0 is considered then ρ 0 is first computed as above and then replaced by ρ 0 = ρ 0 + µ 0 in Equation (205). Equation (221) will not be verified as such but will still hold with some λ 0 instead of λ 0 . With these changes all results in the paper are valid, except that when computing for operational purposes once the price of the prepayment option is computed for all λ one will use λ = λ 0 as price relevant to practice.

We will also need to introduce for any k = 1, ..., N the function Λ

0 k (t) such that ξ(t, Λ 0 k (t), e k ) = K, ∀t ∈ [0, T [. (224)
Of course, Λ 0 X 0 (0) = λ 0 . Recall that ∀t ∈ [0, T ], ξ(t, λ, e k ) is decreasing with respect to λ; when ξ(t, 0, e k ) < K there is no solution to eqn. (221) and we will chose by convention Λ 0 k (t) = 0.

Further properties of the PVRP ξ

It is useful for the following to introduce a PDE formulation for ξ. To ease the notations we introduce the operator A R that acts on functions v(t, λ, X) We illustrate here the term-structure of the liquidity cost in bps in 3 several regimes : recession (dashed), stable(solid) and expansion(dotted). L 0,T = -1 T ln (f k (T ))

Remark 25 A particular treatment is to be given to the situation when some Λ k (t) = 0. In this situation the elliptic part of the evolution PDE (232) is degenerate at λ = 0; then the solution is given a meaning in the sense of viscosity solutions, see [START_REF] Michael | User's guide to viscosity solutions of second order partial differential equations[END_REF] for an introduction, [START_REF] Barles | The dirichlet problem for semilinear secondorder degenerate elliptic equations and applications to stochastic exit time control problems[END_REF] for a treatment of degenerate PDEs and [START_REF] Achdou | Computational Methods for Option Pricing[END_REF] for an explanation of how the introduction of weighted Sobolev spaces can also help to give a meaning to this equation. In this case no boundary conditions are needed at λ = 0 as the solution will select by itself the right value. Another way to see the solution is to consider it as the limit of Cauchy problems with homogeneous Dirichlet boundary conditions set on the domain N k=1 {(t, λ)|λ > Λ k (t) + } and let → 0.

Proof. The valuation problem of an American option goes through several steps: first one introduces the admissible trading and consumptions strategies cf. [START_REF] Musiela | Martingale Methods in Financial Modelling[END_REF]Chapter 5]; then one realizes using results in cited reference (also see [START_REF] Myneni | The pricing of the American option[END_REF][START_REF] Lamberton | Introduction to stochastic calculus applied to finance[END_REF]) that the price P (t, λ, X) of the prepayment option involves computing a stopping time associated to the pay-off. Denote by T t,T the ensemble of stopping times between t and T , we conclude that: P (t, λ, X) = sup τ ∈T t,T E e -τ t r+lu+λudu χ(t, λ τ , X τ ) λ t = λ, X t = X .

We note that for a given Λ if τ Λ is the stopping time that stops upon exiting the domain N k=1 (t, λ) λ > Λ k (t), t ≤ T then P Λ (t, λ, X) = E e -τ Λ 0 r+lu+λudu χ(t, λ τ Λ , X τ Λ ) λ t = λ, X t = X .

Thus for any Λ we have P ≥ P Λ ; when Λ has some null coordinates the continuity (ensured among others by the Remark 25) shows that we still have P ≥ P Λ . In particular for Λ * we obtain P ≥ P Λ * ; all that remains to be proved is the reverse inequality i.e. P ≤ P Λ * .

To this end we use a similar technique as in Thm. 10.4.1 [59, Section 10.4 page 227] (see also [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF] for similar considerations). First one can invoke the same arguments as in cited reference (cf. Appendix D for technicalities) and work as if P Λ * is C 2 (not only C 1 as the hypothesis ensures).

Denote D Λ * = N k=1 (t, λ) λ ∈ [0, Λ * k (t)] (which will be the exercise region) and C Λ * its complementary with respect to R 2 + × E (which will be the continuation region). The Lemma 18.5 shows that A R P Λ * is non-positive everywhere (and is null on C Λ * ). The Îto formula shows that d e -t 0 r+ls+λsds P Λ * (t, λ t , X t )) = e -t 0 r+ls+λsds (A R P Λ * )(t, λ t , X t ))dt+d(martingale) (239) Taking averages and integrating from 0 to some stopping time τ it follows from A R P Λ * ≤ 0 that P Λ * (t, λ, X) ≥ E e -τ 0 r+lu+λudu P Λ * (t, λ τ , X τ ) λ 0 = λ, X 0 = X ≥ E e -τ 0 r+lu+λudu χ(t, λ τ , X τ ) λ 0 = λ, X 0 = X .

Since this is true for any stopping time τ the conclusion follows.

Lemma. Under the hypothesis of the Thm. 24 the following inequality holds (strongly except for the values (t, λ, X) = (t, Λ * j , e k ) and everywhere in a weak sense):

(A R P Λ * )(t, λ, X) ≤ 0, ∀λ > 0, ∀X.

Proof. The non-trivial part of this lemma comes from the fact that if for fixed k we have for λ in a neighbourhood of some λ 1 : P Λ * (t, λ, e k ) = χ(t, λ, e k ) this does not necessarily imply (A R P Λ * )(t, λ 1 , e k ) = (A R χ)(t, λ 1 , e k ) because A R depends on other values P Λ * (t, λ, e j ) with j = k.

From (232) the conclusion is trivially verified for X = e k for any λ ∈ ]Λ * k (t), ∞[. We now analyse the situation when λ < min j Λ * j (t); this means in particular that 0 ≤ λ < min j Λ * j (t) ≤ Λ 0 (t) for any thus Λ 0 (t) > 0. Note that Λ * k (t) < Λ 0 k (t) implies ξ(t, Λ * k (t), e k ) ≥ ξ(t, Λ 0 k (t), e k ) = K for any k = 1, ..., N thus χ(t, λ, e k ) = ξ(t, λ, e k )-K for any λ ∈ [0, Λ * k (t)] and any k. Furthermore since λ < min j Λ * j (t) we have P Λ * (t, λ, e k ) = χ(t, λ, e k ) = ξ(t, λ, e k ) -K for any k. Fix X = e k ; then

(A R P Λ * )(t, λ, e k ) = (A R χ)(t, λ, e k ) = (A R (ξ -K))(t, λ, e k ) = (A R ξ)(t, λ, e k ) -A R (K) = -(δ • λ + r + ρ 0 )K + (r + l k + λ)K = K(l k + (1 -δ)λ -ρ 0 ) ≤ K(l k + (1 -δ)Λ * k (t) -ρ 0 ) ≤ 0 (241)
the last inequality being true by hypothesis. A last situation is when λ ∈] min j Λ * j (t), Λ * k (t)[; there P Λ * (t, λ, e k ) = χ(t, λ, e k ) but some terms P Λ * (t, λ, e j ) for j = k may differ from χ(t, λ, e j ). The computation is more subtle is this case. This point is specific to the fact that the payoff χ itself has a complex structure and as such was not emphasized in previous works (e.g., [START_REF] Zhang | Closed-form solutions for perpetual American put options with regime switching[END_REF], etc.).

Recalling the properties of ξ one obtains (and since P Λ * (t, λ, e k ) = χ(t, λ, e k )):

(A R P Λ * )(t, λ, e k ) = (Aχ)(t, λ, e k ) -(r + l k + λ)χ(t, λ, e k ) + N j=1 a k,j P Λ * (t, λ, e j ) -χ(t, λ, e k ) = (A R χ)(t, λ, e k ) + N j=1 a k,j P Λ * (t, λ, e j ) -χ(t, λ, e j ) = (A R ξ)(t, λ, e k ) -A R (K) + N j=1 a k,j P Λ * (t, λ, e j ) -χ(t, λ, e j ) = -K(δ • λ + r + ρ 0 ) + (r + l k + λ)K + N j=1 a k,j P Λ * (t, λ, e j ) -χ(t, λ, e j ) ≤ 0,

where for the last inequality we use hypothesis (238). Finally, since we proved that (A R P Λ * )(t, λ, X) ≤ 0 strongly except for the values (t, λ, X) = (t, Λ * j (t), e k ) and since P Λ * is of C 1 class we obtain the conclusion (the weak formulation only uses the first derivative of P Λ * ).

Remark 26 Several remarks are in order at this point:

1. when N > 1 checking (238) does not involve any computation of derivatives and is straightforward.

2. as mentioned in the previous section, the Theorem is a verification result i.e., only gives sufficient conditions for a candidate to be the option price. In particular we do not have to prove that a boundary Λ * does exist and satisfies the hypothesis of the Theorem; however see results in the literature ( [START_REF] Chen | A mathematical analysis of the optimal exercise boundary for american put options[END_REF] and references within) that indicate that the boundary will probably be even more regular, C ∞ on [0, T [. The behaviour near final time T is not expected to be singular with respect to λ (because there is no singularity in the payoff function there) but we do not exclude that lim t↑T dΛ * k (t) dt = ∞ which is equivalent to say that the derivative with respect to λ of the inverse of t → Λ * k (t) is null.

Numerical Application

The numerical solution of the partial differential equation ( 232) is required. We detail below the use of a finite difference method as discretization choice, but some cases may require different treatment.

To avoid working with an infinite domain we truncate at λ max . Then a boundary condition is imposed on λ max which leads to a numerical problem in the finite domain ∪ N k=1 {(t, λ) λ ∈ [Λ k (t), λ max ]}. We introduce the time step ∆t and space step ∆λ and look for an approximation P n ,k of P Λ (n∆t, ∆λ, e k ). The first and second derivative are approximated by (centred) finite difference formula and the time propagation by a Crank-Nicholson scheme:

P n+1 ,

= 0

A standard computation shows that the truncation error of this scheme is O(∆t 2 + ∆λ 2 ).

See also Remark 25 for the situation when some Λ k (t) is null: there the PDE for regime e k is defined over the full semi-axis λ > 0 i.e., it is never optimal to exercise in this regime. The PDE is defined with homogeneous boundary conditions at λ max (or Neuman, see below) and without any boundary conditions at λ = 0. To ensure the same number of equations and unknowns the equation is discretized at λ = 0 too but the second order derivative is null there. Only first order terms and a first order derivative remain. The first order derivative is discretized with a lateral second order finite difference formula that involves only the function values at λ = 0, ∆λ, 2∆λ using the identity:

f (x) = -3 2 f (x) + 2f (x + h) -1 2 f (x + 2h) h + O(h 2 ). (243)
We consider a numerical application with λ max = 1000 bps, ∆λ = 1/5 bps and ∆t = 1/12. Two approaches have been considered for imposing a boundary value at λ max : either consider that P Λ (0, λ max , e k ) = 0, ∀k = 1, ..., N (homogeneous Dirichlet boundary condition) or that ∂ ∂λ P Λ (0, λ max , e k ) = 0, ∀k = 1, ..., N (homogeneous Neuman boundary condition). Both are correct in the limit λ max → ∞. We tested the precision of the results by comparing with numerical results obtained on a much larger grid (10 times larger) while using same ∆λ. The Neumann boundary condition gives much better results for the situations we considered and as such was always chosen (see also Figure 35).

We consider a loan with a contractual maturity T = 5 years, a nominal amount K = 1, a recovery rate δ = 40% and the borrower default intensity λ t follows a CIR dynamics with parameters: initial intensity λ 0 = 150 bps, volatility σ = 0.1, average intensity θ = 150 bps, reversion coefficient γ = 0.5. We assume a constant interest rate r = 1% and a liquidity cost defined by a Markov chain of three states l 1 = 15 bps, l 2 = 30 bps and l 2 = 250 bps. For N = 3 the rate 3 × 3 matrix A is defined as following,

A =   -1 2 1 2 0 1 -2 1 0 1 10 -1 10   . (244)
So we obtain a term-structure for each state (see also Figure 31). At inception, we assume the liquidity cost is in the state 1, so X 0 = e 1 . Recall that a basis point, denoted "1 bp" equals 10 -4 . In order to find the initial contractual margin we use equation ( 222) and find ρ 0 = 228 bps at inception in the state 2. For information, the contractual margin would be ρ 0 = 175 bps in the lowest state 1 and it should be ρ 0 = 313 bps in the highest state 3. For reminder, the contractual margin takes into account the credit risk (default intensity) and the liquidity cost.

The function Λ * k (t) is obtained by maximizing P Λ (t, λ, X 0 ) backward for all t ∈ [0, T [ and each state k. To accelerate the optimization process, for the initial guess at step at t = T -∆t we note that there is little time to switch from the current regime to an other. Therefore, we use the optimal For the numerical application in Section 19 we plot the prepayment option price in bps at inception P (0, λ, X) (solid) and pay-off χ(0, λ, X) (dashed) as a function of the intensity λ in the state X = e 1 (top), the state X = e 2 (middle) and the state X = e 3 (bottom). Two regions appear: the continuation λ > Λ * k (0) and the exercise region region λ <= Λ * k (0) except in the third state where there is no exercise region.

Part V

Perspectives and conclusions

This PhD thesis investigates the pricing of a corporate loan according to the credit risk, the liquidity cost and the embedded prepayment option. We propose different models to assess the loan price and its sensitivities to several variables: default intensity, liquidity cost, short-interest rate. For each model, numerical results are presented to show that they are completely consistent with the theory.

Conclusions

The first model concerns the prepayment option of perpetual corporate loans in a one-dimensional (infinite horizon) framework with constant interest rates. When a unique regime case is considered we establish quasi analytic formulas for the payoff of the option. We give a verification result that allows to compute the price of the option for one-regime case and multi-regime case. The numerical results show that the prepayment option cost is not negligible and should be taken into account in the asset liability management of the bank. Moreover it is seen that when liquidity parameters are very different (i.e., when a liquidity crisis occur) in the high liquidity cost regime the exercise domain may entirely disappear, meaning that it is not optimal for the borrower to prepay during such a liquidity crisis. This finding is consistent with the banking practice and confirms the validity and qualitative properties of the model.

The second model improves the pricing of the perpetual prepayment option by considering a two-dimensional setting with the short interest rate following a CIR dynamics. The verification results allow to certify the geometry of the exercise region. Moreover we show that the price is the solution of a constrained minimization problem and propose a numerical algorithm in a two-dimensional code. The numerical results show that the sensitivity of the loan price to the short-interest rate is negligible in several situations, so we can assume that the short interest rate is constant.

The third model presents an accurate pricing method of a corporate loan and its prepayment option in a non-perpetual (finite horizon) multi-regime situation. Unlike the previous models, this model is not perpetual but has a finite maturity (horizon), which allows to price term loans in the market. This setting allows to define the term structure of the liquidity cost, which was not possible in the perpetual case. Moreover, the numerical search for the exercise frontier is much more difficult than in the time-independent setting where one point per regime is to be found. We propose a backward numerical algorithm to calculate a curve representing the exercise frontier for any regime. The numerical results show that the prepayment option and its exercise frontier depend on the time.

Perspectives

Our work on the loan prepayment and the loan pricing enables us to understand the different risks related to a loan and to propose a pricing model. This subject is innovative and complex, and several topics have still to be addressed in an academic and financial fields.

It would be interesting to study the following academic questions:

• implement an algorithm with more than three regimes.

• define an instantaneous liquidity cost of the bank with a stochastic process whose parameters depend on the state of the economy.

• quantify whether it is necessary to use a stochastic short-term interest rate in the finite horizon case as we did in the two-dimensional model of the infinite horizon case. On a numerical level, we would need to define an algorithm combining the optimisation in a two-dimensional region and a time continuity.

• improve the technical assumption of the uniqueness quantification of the exercise and continuation regions (necessary albeit not sufficient condition).

• assess the existence and uniqueness of the risk-neutral measure"; if nonuniqueness how to chose among the several prepayment option prices ?

• investigate if the Markov chain is the best approach for the regimes or if an effective model of jump diffusion would more realistic even though more complex.

• extend the process of diffusion of the default intensity to other models like CIR++ for example. It is also important to test if these models are consistent with the current theory.

• study the convergence of the finite horizon model towards the infinite horizon model.

It would also be interesting to study the following financial questions in the future:

• introduce a discrete payment of the cash-flows (e.g. quarterly basis).

• extend the pricing to the revolving credit facility, which is a loan with variable and unknown cash-flows depending on the drawn amount. So we need to take into consideration a drawing probability on the committed credit line.

• account for the option cost in the margin calculation. This will change the pay-off of the option.

Figure 1 :

 1 Figure 1: IAS 39 Algorithm of Fair Value

Figure 2 :

 2 Figure 2: We illustrate here the S&P classification ranged from AAA for the best obligors to C for the riskiest one where each rating is related to a historical default rate.

Figure 3 :

 3 Figure 3: ZC bond over one period with two terminal scenarii: No default and Default

Figure 4 :

 4 Figure 4: According to the Merton model, the value of the firm V is split up into debt D and equity E. D is an obligation that has to be repaid at a fixed price in the future at time T .

Figure 5 :

 5 Figure 5: Different cash flows occurred between the buyer and the seller according to the reference entity default and the type of settlement (physical or cash).

Figure 7 :

 7 Figure 7: Euro market funding costs of BNP Paribas by maturity buckets

Figure 8 :

 8 Figure 8: US Dollar market funding costs of BNP Paribas by maturity buckets

Figure 9 :

 9 Figure 9: Basel Committee milestones

  Figure 10: We illustrate here the term-structure of the liquidity cost in bps in 3 several regimes : recession (dashed), stable(solid) and expansion(dotted). L 0,T = -1 T ln (f k (T ))

1 .

 1 on ]0, Λ * [ we have P (λ) = χ(λ) = (ξ(λ) -K) + and the relation (89) holds; 2. the solution candidate P (λ) satisfies the relation (AP )(λ) -(r + λ)P (λ) = 0, ∀λ > Λ * . (84) 3. the function P (λ) is C 1 everywhere, continuous at the origin and C 2 on each sub-interval ]0, Λ * [ and ]Λ * , ∞[.

  λ 0 + ) < 0 for any > 0 hence Υ(λ 0 ) ≤ 0. Thus it is natural not to look for Λ * outside the interval [0, λ 0 ]. The theorem asks furthermore to restrict the search to the interval [0, λ 0 ∧ ρ 0 ].A different convenient procedure to find the critical Λ * is to consider the dependence Λ → P Λ (λ 0 ). Let us consider the stopping time τ Λ that stops upon entering the domain [0, Λ]. We remark that by a Feynman-Kac formula (cf.[59, p 203])

Figure 12 :Figure 13 :

 1213 Figure12: Loan value as a function of the intensity. The loan value is decreasing when there is a degradation of the credit quality (i.e., λ increases) and converges to 0.

  122)-(124) are satisfied. 4. the search for the candidate Λ * can be done either by looking for a zero of the function Λ → Υ(Λ) := ∂P Λ * (λ,e k )

.

  Having established the two extremal points the candidate Λ * (A) is searched within the N -dimensional segment [Λ * (0), Λ * (∞A)].

Figure 15 :

 15 Figure15: Loan value as a function of the intensity. Top: regime X = e 1 ; bottom: regime X = e 2 . The loan value is decreasing when there is a degradation of the credit quality (i.e. when λ increases) and converges to 0.

Figure 16 :

 16 Figure16: The price of the prepayment option P Λ * (λ) (solid line) and the payoff χ(λ) (dashed line) as function of the intensity λ. Top: regime X = e 1 ; bottom: regime X = e 2 . For each regime two regions appear : the continuation region λ > Λ * i and the exercise region λ ≤ Λ * i .

Figure 18 :Figure 19 :

 1819 Figure18: Loan value as a function of the intensity. Top: regime X = e 1 ; bottom: regime X = e 2 . The loan value is decreasing when there is a degradation of the credit quality (i.e. when λ increases) and converges to 0.

  λ

Figure 20 :Figure 21 :

 2021 Figure 20: PVRP value as a function of the intensity (left: ξ(r 0 , λ) ) and LIBOR (right: ξ(r, λ 0 )) for the inputs in Section 13.1.

  λ

Figure 23 :Figure 24 :

 2324 Figure 23: The price P (r, λ) for the inputs in Section 13.1.

Figure 26 :

 26 Figure 26: The optimal boundary: Γ * 1 in regime X = e 1 (solid line) and Γ * 2

Figure 27 :

 27 Figure 27: The price of the prepayment option P (r, λ, X) as function of the intensity and LIBOR for the inputs in Section 13.2. Left: regime X = e 1 ; Right: regime X = e 2 .

0 0 .Figure 28 :Figure 29 :

 02829 Figure 28: The optimal boundary: Γ * 1 in regime X = e 1 (solid line) and Γ * 2 in regime X = e 2 (asterisk line) as function of the LIBOR r for the inputs in Section 13.3. Recall that the continuation region is above the boundary and the exercise region below the boundary. The results are similar to the situation with no correlation.

  Figure 30: We illustrate here the term-structure of the liquidity cost in bps in 3 several regimes : recession (dashed), stable(solid) and expansion(dotted). L 0,T = -1 T ln (f k (T ))

Figure 32 :Figure 33 :Figure 34 :

 323334 Figure 32: For the numerical application in Section 19 we search for the exercise boundary Λ * k (T -dt) that maximize the option price in the state X = e 1 (top) and in the state X = e 2 (middle) and in the state X = e 3 (bottom). We obtain Λ * 1 (T -dt) = 339 bps, Λ * 2 (T -dt) = 301 bps and Λ * 2 (T -dt) = 0 bps. Remark: The state X = e 3 is a particular case where there exist no exercise boundary since the pay-off is null for all λ T -dt > 0.

EUR Market Liquidity Costs by maturity buckets BNP Paribas

		300
		250
		200
	bps	150
		100
		50
		0
		Jan11	Feb11	Mar11	Apr11	May11	Jun11	Jul11	Aug11	Sep11	Oct11	Nov11	Dec11	Jan12	Feb12
									Margin
							]0Y;1Y]	]1Y;2Y]	]2Y;3Y]	]3Y;4Y]	]4Y;5Y]

  k -P n

			∆t	,k	+	γ(θ -( ∆λ)) 2	P n+1 +1,k -P n+1 -1,k 2∆λ	+	P n +1,k -P n -1,k 2∆λ
	+	σ 2 4	( ∆λ)	P n+1 +1,k -2P n+1 ,k + P n+1 -1,k ∆λ 2	+	P n +1,k -2P n ,k + P n -1,k ∆λ 2
	-(r + l k + ( ∆λ))	P n+1 ,k + P n ,k 2	+	N j=1	a k,j	P n+1 ,j -P n+1 ,k 2	+	P n ,j -P n ,k

Remerciements

Note that µ is solution to the following PDE (of Fokker-Plank / forward Kolmogorov type):

Thus

which provides the last term in the scalar product part and also the continuous antisymmetric bilinear form 1≤j<k≤N (R + ) 2 a k,j µ k (u j v k -u k v j ) 2

. This concludes the proof of (174).

Since b is continuous u, v + b (u, v) is a continuous bilinear form on H × H . Moreover this form equals a on a dense subset, thus a admits a unique continuous extension to H × H given by u, v + b (u, v). We still denote by a this extension.

We prove in Section 15 that ξ, χ, P ∈ H . Since a (•, χ) is a continuous linear form on H one can represent it as

Consider (u n ) n∈N a minimizing sequence for the problem. There exists

which shows that u n 2 is bounded. Up to extracting a subsequence one can assume that (u n ) n is weakly convergent to some U . Taking into account the 15 Regularity properties for ξ, χ, P Ω *

Regularity for ξ

Recall first equation (148) that gives an uniform (in r, λ, X) L ∞ bound for ξ. Also note that equation (154) is pointwise satisfied for all r > 0, λ > 0, X ∈ E.

In order to prove further regularity properties for ξ two distinct ways are possible: the probabilistic interpretation or the PDE. We will prefer the PDE version in order to be more close to the results required in Section 12.

Let us first fix X = e k and some r > 0, λ > 0. Then equation ( 154) is true in some open ball B around r > 0, λ > 0 of radius min{r, λ}/2. It can be written, with convention ξ k (r, λ) = ξ k (r, λ, e k ), as:

where F k , G k are functions (depending on ξ) bounded in L ∞ by a given, known, constant M . From the definition of the ball B the operator A k is strictly coercive on B. Thus ξ k is solution of a strictly elliptic problem. Standard PDE results imply that ξ k (r, λ) ∈ W 2,∞ (B) i.e., the space of functions that have two L ∞ derivatives. But then, as F k and G k are defined in terms of ξ k they are also in W 2,∞ . The process is then bootstrapped to obtain, together with standard Sobolev embeddings that ξ k is C ∞ at (r, λ). An alternative proof is to use the tangent process (see [START_REF] Protter | Stochastic Integration and Differential Equations: Version 2.1[END_REF] Theorem 39 chapter V) to obtains bounds for the derivatives with respect to r and λ.

Let us now compute, since ξ is regular locally, a (ξ, ξ) according to its definition in equation ( 171)

for some constant C. If suffices now to recall that the first order moment

Part IV

Finite horizon corporate loans: One-Dimension space model

Abstract

We investigate in this part a prepayment option related to a finite horizon corporate loan. The default intensity of the firm is supposed to follow a CIR process and the short interest rate is assumed constant according to the previous results. The liquidity cost follows a discrete space Markov jump process. The prepayment option needs specific attention as the payoff itself is an implicit function of the parameters of the problem and of the dynamics. We give a verification result that allows to compute the price of the option. Numerical results are also presented and are completely consistent with the theory; it is seen that when liquidity parameters are very different (i.e., when a liquidity crisis occur) in the high liquidity cost regime the exercise domain may entirely disappear meaning that it is not optimal for the borrower to prepay during such a liquidity crisis. The method allows to quantify and interpret these findings.

as follows:

(225) Having defined the dynamics (198) and ( 202) one can use an adapted version of the Feynman-Kac formula in order to conclude that PVRP defined by (205) satisfies the equation:

Remark 23 When the dynamics involves different coefficients of the CIR process for different regimes (cf. also Remark 19) the Equation (226) changes in that it will involve, for ξ(•, •, e k ), the operator

instead of A.

Term-structure of the liquidity cost

The continuous time Markov chain allows to define the liquidity cost of the bank to access the cash on the market according to several distinct regimes. Therefore, in each regime, we can build a term-structure of the liquidity cost that refers to the cost at different term. In the more stressful regime, the curve will be inverted. It is the rarest type of curve and indicates an economic recession (see Figure 30). The liquidity cost L t,T for a contractual maturity T at time t is defined by the following equality:

Therefore,

Valuation of the prepayment option

The valuation problem of the prepayment option can be modelled as an American call option on a risky debt owned by the borrower. It is not a standard option but rather a compound product because the payoff is itself a contingent claim. The prepayment option allows borrower to buy back and refinance his/her debt according to the current contractual margin at any time during the life of the option.

As discussed above, the prepayment exercise results in a pay-off (ξ(t, λ) -K) + for the borrower. The option is therefore an American option on the risky λ with pay-off:

The following result allows to compute the price of the prepayment option.

Theorem 24 Consider the vector function

Lipschitz for any k = 1, ..., N ; define the function P Λ (t, λ, X) such that:

P Λ (T, λ, e k ) = 0, k = 1, ..., N and ∀λ > 0.

Suppose a vector function Λ * : [0, T ] → (R + ) N (satisfying same hypotheses as above) exists such that Λ * (t)

] and for all k = 1, ..., N and ∀t ∈]0, T [:

∀λ ∈] min . This initial guess is validated by computing the value P Λ (t, λ 0 , X 0 ) for all neighbours around (Υ * k (T -∆t)) N k=1 in the N-dimensional space where Λ belongs.

Then for each time t < T -∆t, we search the optimal boundary in the neighbourhood of the previous optimal boundary obtained at t + ∆t.

To be accepted, this numerical solution has to verify all conditions of the Theorem 24. The hypothesis (236) and (238) are satisfied (see Figure 35) and the hypothesis (238) is accepted after calculation. Moreover

t) and the analogous holds for Λ * 2 (t). In the state X 0 = 1 and at inception, the present value of cash flows is at par, so ξ(0, λ 0 , X 0 ) = 1. The prepayment option price is P (0, λ 0 , X 0 ) = 0.0136. Therefore the loan value equals ξ(0, λ 0 , X 0 ) -P (0, λ 0 , X 0 ) = 0.9864.

The loan value will equal to the nominal if the intensity decreases until the exercise region λ ≤ Λ * see Figure 34. The continuation and exercise regions are depicted in Figure 35.