Measuring expected time to default under stress conditions for corporate loans

We present a new measure of extreme credit risk in the time domain, namely the conditional expected time to default (CETD). This measure has a clear interpretation and can be applied in a straightforward way to the analyses of loan performance in time. In contrast to the probability of default, CETD provides direct information on the timing of a potential loan default under some stress scenarios. We apply a novel method to compute CETD using Markov probability transition matrices, a popular approach in the survival analysis literature. We employ the new measure to the analysis of changing credit risk in a large portfolio of corporate loans. CETD changes through time in line with other measures of credit risk and is positively related to output growth.


Introduction
Banks lending money to nonfinancial companies are particularly interested in analyses of corporate defaults. The focus is usually on potential losses associated with these defaults, whereas the exact timing of defaults has been less investigated until now.
Analyzing time of corporate default is important because it may help banks diversify credit portfolios and, thus, spread losses through time rather than experience multiple losses at the same time. It may also help organize lending policies in credit institutions in a way that could decrease potential losses incurred due to loan defaults. Estimates of time to default can also be used to predict the profitability of risky loan portfolios or to simulate credit losses in stress conditions (e.g., Andreeva et al. 2007;Bellotti and Crook 2013). Because the time to default can greatly vary depending on the type of business, size, the industry in which the borrowing company operates, or the general economic situation, estimates of time to default can be exceptionally useful for minimizing the consequences of economic crises and economic breakdowns when the number of defaults increases.
In this study, our aim is to analyze time to default for corporate loans under stress conditions. We estimate time to default for loans in the aggregate portfolio of corporate loans in the Polish economy between Q1 2007 and Q1 2015. We also investigate time to default in sixteen separate economic sectors of this economy to assess and compare their performance in time. The sample contains two large financial crises in the region, i.e., the 2008-2009 global financial crisis and the 2011-2012 sovereign debt crisis. Both of them had an impact on the quality of loans in the Polish banking system. Thus, we aim to assess how adverse economic conditions affect time to default of corporate loans, i.e., how quickly good-quality loans turn into nonperforming claims in a stress scenario. We expect large differences of time to default between calm and crisis periods.
As the expected time to default (ETD) for corporate loans in a healthy banking system is usually remarkably high (e.g., exceeding even 200 quarters), ETD is difficult to analyze comparatively. Therefore, we propose a new measure of expected time to default for a loan conditional on this time being extremely short. The ETD conditional on a crisis scenario whereby a loan portfolio performs poorly, i.e., loans default rapidly in this portfolio, is of special interest for us. Such a conditional ETD (CETD) measure indicates the time when a credit default can be expected for a given group of loans under stress conditions. First, we check whether our new measure behaves in a similar way to other measures of loan quality, i.e., survival probability, expected time to default, and the n-th percentile of the distribution of time to default. We find a strong connection between all investigated measures in our sample. Second, it is of interest how the time to default changed with time for corporate loans in Poland, and whether it was linked to important macroeconomic and financial factors such as GDP growth, market interest rate, and the growth rate of bank lending to firms. Therefore, we estimate Poisson autoregressive models with exogenous covariates (PARX) explaining changes in loan ratings with macroeconomic variables and find that a higher rate of economic growth (also related to more rapid lending growth) indeed extended time to default for corporate loans in all economic sectors. At the same time, the effect of interest rate changes was negligible. The estimated models also enable us to consider a systemic risk scenario whereby output and credit growth are extremely low and the market interest rate is exceptionally high. The reaction of CETD to such a scenario would be statistically and economically significant, and the time to default for an average loan in the group of 5 percent worst-performing corporate loans would decrease by 1.2 quarters after a 1 percentage point (1 pp) drop in GDP growth.
Until now, only a few studies have focused explicitly on the timing of expected defaults, while most economists have considered probabilities of default, frequencies of rating transitions, or expected losses as a function of a given time horizon (e.g., 1 year; Crouhy et al. 2000). Bystrom and Kwon (2007) proposed the use of the ETD as a superior measure of credit risk. They derived the ETD from a model in which defaults were analyzed under a risk-neutral measure. The risk-neutral probabilities of default are usually higher than the actual probabilities of default (i.e., PDs calculated under the physical measure). Hence, the ETD under the risk-neutral measure should be lower than the ETD under the physical measure. Therefore, the results obtained by Bystrom and Kwon (2007) should be treated as the lower limit of the actual ETD for a given financial instrument. In contrast, our ETD conditional on a "bad luck" scenario is computed under the physical measure and provides an assessment of the actual credit risk. Ebnöther and Vanini (2007) developed a measure called the time-conditional expected shortfall (TES) to quantify the risk of a credit portfolio during a multiperiod horizon. TES reflects the expected cumulative loss at a given time in the future, conditional on the event that the earlier loss exceeds the chosen quantile (VaR). For example, TES measures the conditional expected future trend of losses, given that the annual loss is not acceptable to the lending institution.
Although there exists a vast literature on modeling defaults of corporate loans (e.g., Glasserman 2007;Bluhm et al. 2010;Sun et al. 2014;Filipe et al. 2016), only a few studies analyze credit risk in less advanced economies and in separate industries. Cifter et al. (2009) find that credit defaults are linked with industrial credit cycles in Turkey. Aretz and Pope (2013) include Malaysia in the group of 24 examined countries. They find that global and country factors also affect credit risk. Research on aggregate country portfolios suggests that there exists a relationship between macroeconomic recessions and increasing credit risk in emerging markets including Poland (Beck et al. 2013;Klein 2013). To our best knowledge, our study is the first to directly analyze time to default for corporations in specific sectors of an economy.
In the next section, we describe our simple theoretical model for rating transitions and define the CETD as our measure of credit risk. In the third section, we discuss our data and the identification method used to classify corporate loans into five risk categories. Empirical results present the changes of CETD in time and the differences across economic sectors. The final section presents our conclusions and policy advice.

Time evolution of credit ratings
The credit quality of a loan contract in a given economic sector may change through time. We assume that a corporate loan can be assigned to one of five credit risk categories (credit ratings or states) S = {1, 2, .., 5}, discussed in more detail in Sect. 3. The state of default (lost credit), defined as 5 ( j = 5), is assumed to be the absorbing state, whereas the other states (normal for j = 1, under observation for j = 2, substandard for j = 3, and doubtful for j = 4) are transient. In every economic sector, we observe time evolution of numbers of loans in each credit category and numbers of transitions between credit states. Let N j,t denote the number of expositions at the beginning of quarter t belonging to credit ranting j ∈ S, and let N i j,t be the number of transitions in period t from state i ∈ S\{5} to credit risk category j ∈ S. Therefore, time evolution of credit quality is well described by times series of event counts: (N j,t ) t=1,2,... , (N i j,t ) t=1,2,... . Observe that for every i ∈ S\{5}, the following identity holds: (1) Hence, at the beginning of each period, the number of expositions in state i is equal to the sum of credit transitions from state i to the same or different credit categories. Finally, we define the matrix of transition probabilities between credit states, P t = [ p i j,t ] i, j∈S , using the formulas p i5 = 0, i = 1, 2, 3, 4, and p 55,t = 1. (3)

Estimation of transition probabilities
The simple method to estimate p i j,t , given the limited number of observations, rests in calculating the average number N i j,t of loan transitions from rating i to rating j and the average number N i,t of expositions with rating i at the beginning of each period in the investigated subsample. This is our first approach with the size of the estimation subsamples equaling twelve quarters. The second approach takes into account the fact that more recent observations weigh more in estimations of transition probabilities. We use a simple exponentially weighted moving average (EWMA) filter to calculate the average number of transitions N i j,t , as well as the number of expositions N i,t needed to calculate p i j,t in Eq. (2). The persistence parameter β = 0.5 controls for the weights of past observations in relation to the current observation. The corresponding half-life parameter measuring the number of periods required for some shock to decay to 50% of its original value equals hl = log(β) log(0.5) = 1. In our third approach, we assume that the numbers of transitions as well as the numbers of expositions are generated by the linear Poisson autoregressive process of order p with covariates, PARX( p) (e.g., Cameron and Trivedi 1986;Brandt and Williams 2001). Then N i j,t (and N i,t , respectively) has a conditional Poisson distribution: where the mean m t is the unobserved state variable. The mean conditional on the information set of events F t−1 observed up to time t − 1, i.e., m t |F t−1 , has a gamma distribution, Γ (σ t|t−1 m t|t−1 , σ t|t−1 ). The conditional mean m t|t−1 and the rate parameter σ t|t−1 evolve according to transition equations: where Var(N i j,t |F t−1 ) is the sample variance of N i j,0 , . . . , N i j,t−1 . Here, ρ 1 , . . . ρ p and δ = [δ 1 , . . . , δ k ] are model parameters; X t = [x 1,t , . . . , x k,t ] is a vector of covariates representing macrofinancial variables. This approach helps us identify links between changes in rating transitions and macroeconomic developments. From (4)-(6) it follows that the conditional distribution of number of credit expositions N i j,t |F t−1 admits negative binomial distribution. The PARX model is estimated using the maximum likelihood method. 1

Markov chain reduction method
At this point, we propose an algorithm to calculate the conditional distribution of time to default for every quarter t and each credit category i ∈ S\{5} under the condition that the credit transition matrix P t = [p i j,t ] i, j∈S is fixed (constant) for the future dynamics of credit expositions. Let P = [p i j ] i, j∈S be a transition matrix of the absorbing Markov chain with states S = {1, 2, 3, 4, 5} describing the quality of corporate loans in a given economic sector. It should be recalled that j = 5 is the only absorbing state in S, i.e., p 55 = 1. We use the graph-reduction method of Górajski (2009) to build an algorithm to determine the conditional distribution, T j 0 , of the time of absorption at the default state j = 5 under the condition that the initial state is j 0 ∈ S\{5}. In particular, we compute the expected time of absorption ET j 0 as well as the variance of the absorption time Let us fix the initial state of a loan as j 0 ∈ S\{5}. Let τ = [τ i j ] i, j∈S be a matrix with random variables, where τ i j is equal to the random transition time between the states i and j. The probability distributions of τ i j for all i, j ∈ S are degenerate to one point: zero or one, depending on whether there is a positive probability of transition between states or not, j∈S for k = 1, 2 denote matrices collecting the first two moments of τ i j . Therefore, the time evolution of the credit quality is given by the following 5 tuple: The Markov chain reduction method tends to decrease the number of states by the specific reductions described in Górajski (2009, Section 3). We apply two types of reductions, namely the loop reduction and the state reduction. Assume that we have a Markov chain S l , P l , τ l , M l 1 , M l 2 after l steps of the algorithm. At the beginning of stage l + 1, we reduce all loops in states S l \{5}. 2 The exit time from a state i ∈ S l \{5} with a loop to a state j ∈ S l , is a sum of random times τ l ii,1 + τ l ii,2 + · · · + τ l ii,k and τ l i j , where k = 0, 1, . . . is the number of loops in the state i, and τ l ii,1 , τ l ii,2 , . . . , τ l ii,k are independently identically distributed times spent in a loop. In the loop reduction step, we remove the possibility of transition from i to i and add the time spent in loops to the time τ l i j of the transition from i to j. Consequently, we set S l+1 = S l and change the transition probabilities p l ii and p l i j to This allows us to derive the transition times from state i to state j, The first two moments of transition time from i to j equal for all j ∈ S l+1 , where q = p l ii . Next, we can reduce a state k ∈ S l \{ j 0 , 5} in the Markov chain X l+1 without loops by deleting all paths to the state k and summing the time of transitions through the state k. To implement the reduction of k, we use the following formulae: The new transition times equal and the first two moments are given by for all i, j ∈ S l . In (7) we consider two disjoint paths between states i and j. The first path links the states i and j directly, whereas the second starts at i and goes to j through the state k. Finally, we obtain the new Markov process X l+2 with a smaller number of states S l+2 = S l+1 \{k}. The reduction method follows according to the scheme After a finite number of steps n, we obtain the reduced Markov chain X n with just two states, S n = { j 0 , 5}, and the random time transition between the initial state, j 0 , and the default, j = 5 given by τ n j 0 5 . Moreover, we have m n j 0 5 (1) = Eτ n j 0 5 , m n j 0 5 (2) = E(τ n j 0 5 ) 2 . Because the reduction method retains the distribution of transition times between the states, we have

Conditional expected time to default
Using the probability distribution T j 0 , we introduce the CETD as a measure of extreme credit risk. Let 1 − α ∈ (0, 1) be our chosen confidence level. The following condition defines the threshold level VaR α (T j 0 ) for the probability distribution T j 0 : VaR α (T j 0 ) can be interpreted as the value at risk of the time to default T j 0 with tolerance level α ∈ {0.05, 0.10}, or equivalently the longest time to default in the set of all α × 100% shortest times to default. Given the fixed level of tolerance α or the corresponding threshold level VaR α (T j 0 ) for a credit exposure in state j 0 , we define the upper and lower conditional expected CETD − α, j 0 , CETD + α, j 0 are not coherent risk measures, but the conditional expected time to default, CETD α (T j 0 ), given by constitutes a coherent risk measure (see Artzner et al. 1999;Rockafellar and Uryasev 2002). Hence, it assumes sub-additivity, positive homogeneity, and translation-equivariability, for all j 0 ,j 0 ∈ S\{5} and t, w > 0. Interestingly, the most popular risk measure in the time domain, namely the probability to default (PD), does not possess the above properties. Properties (13)-(15) are important in analyses of credit risk in portfolio expositions. The first two properties are essential in finding the upper boundary for the risk of the portfolio, whereas the third property enables time shifting in risk analysis.
Using the value at risk in the domain of losses, VaR(L), where L is a loss, enables us to measure the value of extreme losses that occur on a fixed time horizon. However, this measure does not take into account the importance of changing default times. We believe that our CETD is a desirable measure of the time distance to default and a useful measure of credit risk, complementary to the traditional VaR(L).

Data and identification of credit quality ratings
In our empirical research, we consider the claims of commercial banks to nonfinancial enterprises in Poland. The database contains data from all banks in the Polish banking system. Claims include the following balance sheet items: loans, debt and equity instruments, and remaining receivables. The data are based on the so-called large exposure reporting, i.e., the database contains all exposures toward enterprises in excess of 500,000 zlotys (ca. EUR 120,000) per firm from banks that are either jointstock companies, state-run banks, or nonassociated cooperative banks. The database also includes exposures toward enterprises in excess of 100,000 zlotys per firm from (smaller) associated cooperative banks. The data are available at the bank-enterprise level, which means that each record of the database corresponds to a particular firm exposure in a particular bank. All claims to a firm in a given bank are aggregated and are treated as a single exposure.
We use quarterly observations, and our sample starts in Q1 2004 and ends in Q1 2015. Up to Q2 2013, all banks were reporting quality-of-loan exposures classified into one of the five categories, which is keeping with the Polish Accounting Standards (PAS). These five categories are as follows: 1. Normal: when any delay in the repayment of the principal or interest is less than a month, and the economic and financial situation of debtors does not raise any concerns. 2. Under observation: when the delay in the repayment of the principal or interest is more than a month and no more than three months, and the economic and financial situation of debtors does not raise concerns, or when an exposure requires special attention due to the risk associated with the region, state, industry, customer group, or product group. 3. Substandard: when the delay in repayment of the principal or interest is more than three months but no more than six months, or the economic and financial situation of the obligors may constitute a threat to the timely repayment of the exposure. 4. Doubtful: when the delay in the repayment of the principal or interest is more than six months but no more than 12 months, or the economic and financial situation of the obligors is significantly deteriorated, especially when incurred losses significantly breach their equity (net assets). 5. Lost: when the delay in the repayment of the principal or interest is more than 12 months, or the economic and financial situation of the obligors is significantly deteriorated, and the obligors are unable to repay debt (e.g., the company's bankruptcy was announced).
We code all the risk categories of loans with numbers from 1 (normal credit exposure) to 5 (lost credit exposure, or default). Unfortunately, a large number of banks have stopped providing full information on the quality of exposures since Q3 2013 due to a change in reporting standards. From Q3 2013, our database includes information about just two subcategories of loans from banks reporting according to the International Accounting Standard (IAS). Under the IAS No. 39, outstanding loans can only be divided into exposures at risk of losing value and exposures not at risk of losing value, without isolating additional subcategories. The banks reporting under the IAS hold a majority of loans in the Polish banking sector.
With respect to the data from Q3 2013 until the end of the sample, we matched each exposure to one of the five categories using the following information about provisioning. Under Polish law, all banks set provisions for the risk associated with their activities (also known as specific provisions for credit exposures). Each exposure is classified as either normal, under observation, or a risk group (i.e., substandard, doubtful, and lost). For corporations, rules of provisioning indicate that the amount overdue and the economic and financial situation of a debtor are two independent factors that influence its classification to a particular category.
The size of a specific provision is associated with the risk group that is assigned (i.e., 1.5% of the provisioning basis is assumed for normal duties in the group of loans and receivables under observation, 20% for loans below standard, 50% for doubtful receivables, and 100% for lost claims under the national regulations). The basis for provisioning against the credit risk for claims classified as under observation exposures or risk group exposures can be further reduced by the value of collateral, guarantees, or any rights secured by the law. Because the provision can be reduced and we do not have sufficient information about the collateral or guarantees, we assume that this reduction is dependent on the class of economic activity. We calculate the ranges of provision coverage for each category of loan quality in separate sections of the economy (Table 1). 3 Using mathematical notation, the set S corresponds to the five quality categories of credit exposure where each state j ∈ S is identified by the value of reserve requirement R t in period t. More precisely, the credit exposure C t is in state j in period t if the value of provision requirement R t belongs to the fixed interval [r j , r j+1 ), i.e., for all j = 1, 2, . . . , 5, where r 1 < r 2 ... < r 6 .
We are aware that, in practice, the loan quality depends on several factors that are related to the terms of the loan contract, lending policy of the bank, and the financial situation of the borrowers, for example. Those factors correlate with each other. In this research, we assume that the state in a previous period aptly identifies the probability of that state changing in the next period.
It must be noted that any exposure can be removed from the database or reclassified for reasons not necessarily connected with the changing of credit quality. For example, the exposure will be erased from the register when its value falls below the threshold of 500,000 zlotys (or 100,000 zlotys in the case of associated cooperative banks). Banks may also remove defaulted loans from the book. 4 Moreover, banks can merge and harmonize their risk policies, which may cause some loans to be reclassified. We decided to account for loans erased from the books of banks by removing the appropriate observations for loans leaving the book from our estimated sample.

Empirical results
This section includes calculations of the credit risk measures for the aggregate portfolios of corporate loans from 16 individual economic sectors in Poland, as well as for the portfolio of loans from the entire nonfinancial corporate sector of the Polish economy. We compare the estimates for PD, ETD, VaR in the time domain and our new measure of extreme credit risk, CETD.
As an additional application, we present two alternative estimates of transition matrices P t for the aggregate portfolio of corporate loans in Poland. One of the applied methods allows us to verify the impact of key macroeconomic variables, including GDP growth, credit growth, and the interest rate, on the quality of corporate loans. The GDP growth is associated with the current aggregate demand in the economy and is expected to be negatively linked to CETD. High interest rates directly and negatively affect performance of corporate loans due to high financial costs incurred by borrowing companies. On the other side, the increasing rate may also be associated with antiinflationary policies of the central bank and be the sign of recent favorable demand developments pushing consumer prices up. In such a case, it will have a positive effect on loan quality, at least in the short term. In turn, the high credit growth may either be associated with positive aggregate demand effects or with less restrictive credit policies of banks. Again, the final impact on credit risk will depend on the relative strength of the respective channels.

Performance of corporate loans from main economic sectors
Given the sample of quarterly data on loan exposures from Q1 2004 to Q1 2015, we estimate the transition matrices P t using twelve-quarter rolling windows of historical data for each estimated matrix. Based on the estimated transition probabilities, the Markov chain reduction method enables us to compute the probability distribution of time to default T sec j0 (t) for all quarters t ∈ [2007Q1, 2015Q1] and economic sectors sec ∈ {0, 1, 2, .., 16} (sec = 0 denotes the whole economy; cf., Sect. 2.2). Figure 1 in panel (a) presents the cumulative distribution function of T 0 1 (t) for the portfolio of good-quality loans for companies from all sectors (cf., Fig. 2 for analogous CDFs for specific sectors). Because the subsamples used to estimate transition matrices are 3-year samples, the PDs as well as other further measures of credit risk observed at time t should be treated as representative of the whole three-year period of the samples ending at period t.
All figures reveal a limited risk of rapidly deteriorating loan quality within all economic sectors throughout the sample. The time to default of a loan is long even for small cumulative probabilities of default. For example, in 2007 a corporate goodquality loan representative of the whole economy of the time required more than 20 quarters to default with the probability of 0.05 (cf., Fig. 1, panel (a)). In turn, analogous loans from the under observation, substandard, and doubtful categories required, respectively, more than eight quarters, around two quarters, and only one quarter to default with the probability of 0.05. 5 These results suggest that upon entering the state of substandard and doubtful quality, the deterioration process intensifies significantly. The changes of PD in time are also parallel for the four categories of loan quality investigated (cf., Fig. 1, panel (b)).
Another credit risk measure, namely ETD, behaves in a very similar way to the cumulative probabilities of default through time. Figure 1 in panel (c) presents changing mean and standard deviation of T 0 1 (t) for "normal" loans representative of the whole economy. Importantly, the unconditional expected times to default are extremely long, reaching even thousands of quarters for some specific economic sectors. In practice, such results complicate the analysis of risk in loan portfolios because risk scenarios require more plausible time horizons for potential defaults. However, this fact does not prohibit treating ETD as an index of credit risk and observing its changes in time. An interesting finding is the parallel change in the values of ETD and standard deviation of T 0 1 (t), which suggest that the time to default is more uncertain for less risky portfolios. Panel b: annual probabilities of default changing in time. "Normal" loans (with rating "1")-solid black line (left axis), "under observation" loans (with rating "2")-solid gray line (left axis); "substandard" loans (with rating "3")-dashed black line (right axis), "doubtful" loans (with rating "4")-dashed gray line (right axis). Panel c: mean time to default for "normal" loans (black line) and standard deviation of time to default for "normal" loans (gray line) changing in time. Panel d: conditional expected time to default for "normal" loans, changing in time. CETD 0.10 -gray line, CETD 0.05 -black line. Panel e: value at risk changing in time. VaR 0.10 -gray line, VaR 0.05 -black line. Panel f: conditional expected time to default, CETD 0.05 (T j 0 ), changing in time. "Normal" loans (with rating "1")-solid black line (left axis), "under observation" loans (with rating "2")-solid gray line (left axis); "substandard" loans (with rating "3")dashed black line (right axis), "doubtful" loans (with rating "4")-dashed gray line (right axis). Panel g: survival probabilities for "normal" loans, changing in time. Annual survival probability (S P(1Y ))-black line, four-year survival probability (S P(4Y ))-gray line. Panel h: nonperforming loan ratio changing in time We overcome the problem of long, uninterpretable times to default derived from the ETD measures by proposing a CETD that focuses on the tail behavior of time to default. The dynamics of CETD and VaR risk measures for the aggregate portfolio are presented in Fig. 1, panels (d) and (e), respectively. We set plausible tolerance levels at α = 0.10 and α = 0.05 and calculate values at risk VaR 0.10 and VaR 0.05 in the time domain. Here, the times to default are much shorter, but they still rise above 100 quarters for good-quality loans for some specific sectors during more prosperous times. This result suggests relatively conservative lending policies on the part of banks toward nonfinancial firms in Poland. Such policies limit the risk of loan defaults in normal times. The CETD measures confirm this finding and rarely fall below 10 quarters, even for the more conservative values of α = 0.05.
A slightly different picture is revealed when observing the performance of worse quality loans from the substandard and doubtful categories (Fig. 1, panel (f)). These loans are expected to default very quickly under an extreme scenario, as the CETD 0.10 for doubtful loans fluctuates around one quarter through time for most economic sectors. In the stress scenario, the nonperforming loans are usually expected to default immediately. The differences between the values of ETD and CETD measures show the consequences of a likely scenario that is realized on average once in 10 or 20 quarters in the credit market. This finding is important because it suggests that nonperforming corporate loans may, in general, be treated as defaulted exposures in stress events.
The CETD measure calculated for loans from the normal category changes through time in a very similar way to ETD, VaR, and SP(4Y ) measures of credit risk, where SP(4Y ) = 1 − PD(4Y ) is the four-year survival probability of a loan in the investigated portfolio (cf., Fig. 1, panel (g)). These measures can be used interchangeably as indices of credit risk. Interestingly, they do not perfectly match the developments of the nonperforming loan ratio (NPLR), a widely used statistic that assesses loan quality in empirical studies (cf., Fig. 1, panel (h)). One explanation of this result is that NPLR is highly dependent on the dynamics of credit growth and the changing maturity structure of a loan portfolio.
The results, when broken down by sector, confirm anecdotal evidence and do not contradict the indices of credit risk for particular economic activities presented in the Financial Stability Reports (FSR) published semi-annually by the Polish central bank (e.g., Narodowy Bank Polski 2015). Independently from the initial state of a loan exposure, the least credit risk for most sectors is observed in the period between Q1 2007 and Q4 2008 (cf., Figs. 2, 3). As a result of the global financial crisis, the quality of corporate loans deteriorated at the end of 2008 and beginning of 2009. In response to this, credit policies at commercial banks tightened. However, the process of quality deterioration was different depending on the section of the economy. In sectors dominated by huge national infrastructural suppliers, such as those represented by section D (electricity, gas, and steam supply) and Q (health care), the changes in high-quality debt servicing were almost invisible.
The risk increased rapidly in 2009 and revealed a slow upward trend in the following years. In some sectors, short-term improvement in the risk conditions was observable in 2012 (sectors C-manufacturing, H-transportation and storage, and N-administrative activities) and in 2013 (sectors E-water supply, sewerage, and waste management, L-real estate activities). Sector R (arts, entertainment, and recre-  Table 1). CETD 0.10 -gray line, CETD 0.05 -black line ation) has been less dependent on external economic conditions than other sectors, and therefore its associated risk was lowest in 2010, but then it also increased.
The number of insolvencies rapidly rose in mid-2012, and this was a result of worsening conditions in the construction companies (sector F), which had over-invested in earlier years (also during the financial crisis). There were also new bankruptcies of large infrastructural companies, which had to implement their investment projects under unfavorable rules that had been agreed upon prior to the crisis. These problems affected the whole chain of suppliers in the economy and in other sectors as well. A worsening performance of the construction sector (i.e., rapidly falling time to default, as well as small values of this measure in general) is confirmed by the increasing levels of nonperforming loan ratios. A negative trend in world coal prices strongly affected the Polish mining industry (sector B) from the beginning of 2014. The time to default decreased dramatically especially in the group of well-servicing debtors. All calculated measures suggest that the risk in sector H (transportation and storage) was the most stable through time. Although the PDs were relatively high, the financial crisis did not affect this activity much.

Alternative estimates of probability transition matrices
In our previous calculations, we use twelve-quarter rolling windows and sample mean values of transitions to calculate probability transition matrices P t . One disadvantage of using this method is that old observations are as important as the most recent observations in the estimation formula. We may expect that any changes in the estimated transition probabilities (and hence in the times to default) due to changing economic conditions will only be identified with a lag.
We deal with this problem by using two other estimation methods. First, we use the exponentially weighted moving average (EWMA) model to describe the number of transitions between regimes with a persistence parameter set to 0.5 and, hence, the half-life of shocks equal to one quarter. In this way, new observations weigh much more than older observations in our estimations.
Second, we construct the PARX model with three macroeconomic variables and an autoregressive term explaining changes in regimes of corporate loans, as described in Sect. 2.1. This helps us link macroeconomic developments with performance of the corporate loan portfolio.
In Fig. 4, we present changes in CETD calculated from transition matrices P t estimated with (a) the standard ("sample mean") approach, (b) the EWMA model, and (c) the PARX model. All presented results are calculated for the portfolio of good-quality loans with the rating "1." We observe that the standard model generates the most stable and least volatile results and identifies changes in longer-term trends as well. In turn, estimates from the EWMA model are much more volatile and the CETD calculated from these estimates reacts more rapidly to any changes in performance of the lending market. This ability to identify trend reversals early is especially important during financial crises such as the 2008-2009 crisis. Significantly, the estimated CETDs from the PARX model follow closely those from the EWMA model, even though the PARX parameters are estimated using the whole sample and not the moving window samples  as is the case for the two former approaches. Such a property may be valuable when out-of-sample predictions or simulations are considered and the local estimates of the two former approaches are less useful. This result also suggests that macroeconomic developments are indeed responsible for changes in the quality of corporate loans. Next, we show changes in PD, VaR, and CETD caused by the independent shocks to three macroeconomic variables. The model is highly nonlinear and cumulative effects depend on the current values of all explanatory variables. Therefore, the results are presented for the first "normal" scenario where all macroeconomic variables have their "end-of-sample" values and P t equals P T from the end of the sample. We also consider the second "crisis" scenario where output growth and credit growth are extremely small and equal to their VaR 0.05 values, and the interest rate is very high at its VaR 0.95 level. One such scenario could be financial turbulence caused by an economic recession combined with a sudden stop crisis, where the local central bank is forced to defend the currency by increasing interest rates and local banks limit lending to firms. Another example could be a local banking crisis during an economic slowdown. The values of respective variables in both "end-of-sample" and "crisis" scenarios are presented in Table 2.
We show marginal effects of three independent shocks in Tables 3, 4, and 5. All effects are measured using long-run multipliers. In Table 3, effects of shocks to GDP   growth are presented. The positive and negative shocks have an asymmetric impact on PD, VaR, and CETD. For example, CETD 0.10 increases by 5.90 (decreases by 1.65) quarters after a positive (negative) 1 pp shock in the crisis scenario. The effects are also stronger for the crisis scenario than for the "normal" scenario. After a 1 pp negative shock to output growth, CETD 0.05 decreases by more than one quarter in the crisis scenario and by half a quarter in the normal scenario.
Most reactions to a 1 pp interest rate shock are negligible in economic terms ( Table  4). The size of such a shock exceeds the value of four sample standard deviations of the interest rate variable, but CETD 0.05 changes by 0.01 quarters or less in any scenario. Somewhat surprisingly, CETD 0.10 changes by half a quarter in the normal scenario after the interest rate shock, but it does not react at all in the crisis scenario. Furthermore, any reactions of PD to the positive and negative shocks are small. The interest rate variable was also found statistically insignificant in many specifications of the PARX model.
In turn, changes in credit growth have some effect on the quality of loans (Table  5). A negative 5 pp shock (roughly equal to three sample standard deviations of credit growth) reduces CETD 0.05 by half a quarter and CETD 0.10 by one quarter in the crisis scenario. In the "normal" scenario, reactions are slightly weaker. PD reacts stronger to credit growth shocks than to interest rate shocks.
In general, we confirm that higher GDP growth and higher credit growth increase CETD, i.e., they improve the quality of the most vulnerable corporate loans. At the same time, we are unable to identify strong effects of interest rate changes.

Conclusions
This paper presents a new measure of extreme credit risk in the time domain, namely, the conditional expected time to default. It has a clear interpretation and can be applied in a straightforward way to analyses of loan performance in time. We apply a novel method to compute the CETD with the use of the Markov probability transition matrices that are widely used in survival analyses. Empirical study concerning corporate loans from 16 economic sectors in Poland confirms the usefulness of our new measure. CETD changed values in line with other measures of credit risk, including the survival probability, across industries and through the entire investigated sample. Using this measure, we were able to identify the riskiest sectors and the most turbulent periods in the Polish economy.
It is clear that the Markov process is only a rough approximation of the true process generating loan defaults. The main problem is that the Markov transition matrices are dependent on macro-and microeconomic fluctuations, and they are not constant in time or across economic sectors. We deal with these problems by estimating the transition matrices using three methods, including estimation of the PARX models that control for serial dependence of credit risk and for the impact of exogenous variables. Nevertheless, future research may find suitable extensions for our methods. The method of Górajski (2009) used to calculate distributions of time to default can also be applied when transition matrices depend on external factors or when the sizes of the matrices are larger than in our example (more rating categories).
The following are policy lessons from our research. Banks and financial supervisors should increase attention toward loans with the three lowest ratings because these loans default exceptionally rapidly. In the stress-testing scenarios, the lower-quality loans may even be treated as immediately lost. Time to default differs significantly across economic sectors. Therefore, banks, supervisors, and market regulators may be interested in distinguishing between sectoral portfolios while analyzing corporate credit risk in banking institutions. Falling conditional (and unconditional) expected time to default for corporate loans toward the end of the sample, despite the improving economic situation, also suggests that banks might have been either loosening their lending standards or tightening reporting standards in this period. In turn, the popular measure of credit risk, namely, the nonperforming loan ratio, was slightly decreasing in the last quarters. Thus, it is obvious that more informative measures, including PD and CETD, should be used in analyses of credit risk. Finally, our models offer new tools to link credit risk and macroeconomic developments. These models can be used by banks in their credit risk management process. This particular method, for example, could be applied in the stress tests used by banks to observe how default risk materializes over time in response to changes in the economic environment.