Description Usage Arguments Details Value Author(s) References Examples
This function is used to estimate transition probabilities and counts given historical credit data (a.k.a., credit migration data).
1 | TransitionProb(dataTM, startDate, endDate, method, snapshots, interval)
|
dataTM |
a table containing historical credit ratings data (i.e., credit migration data). A dataframe of size nRecords x 3 where each row contains an ID (column 1), a date (column 2), and a credit rating (column 3); The credit rating is the rating assigned to the corresponding ID on the corresponding date. |
startDate |
start date of the estimation time window, in string or numeric format. The default start date is the earliest date in 'data'. |
endDate |
end date of the estimation time window, in string or numeric format. The default end date is the latest date in 'data'. The end date cannot be a date before the start date. |
method |
estimation algorithm, in string format. Valid values are 'duration' or 'cohort'. |
snapshots |
integer indicating the number of credit-rating snapshots per year to be considered for the estimation. Valid values are 1, 4, or 12. The default value is 1, i.e., one snapshot per year. This parameter is only used in the 'cohort' algorithm. |
interval |
the length of the transition interval under consideration, in years. The default value is 1, i.e., 1-year transition probabilities are estimated. |
The two most commonly used methods to estimate credit transition matrices are the cohort (discrete time) and duration (continuous time) methods.
Cohort Method (Discrete-time Markov Chains) - The method most commlonly used by rating agencies is the cohort method. Let P_{ij} (Δ t) be the probability of migrating from grade i to j over a specified time period Δ t. An estimate of the transition probability of a 1 year horizon where Δ t = 1 year is thus:
P_{ij}(Δ t) = \frac{N_{ij}}{N_{i}}
where N_{i} = number of firms in rating category i at the beginning of the horizon, and N_{ij} = the number of firms that migrated to grade j by horizon-end.
It is important to note that any rating change activity which occurs within the period Δ t is ignored, thus leading to information loss.
Duration Method (Continuous-time Markov Chains) - A time homogenous continuous-time Markov chain in a sense uses all of the available information and is specified using a (KxK) generator matrix estimated via the maximum likelihood estimator
λ_{ij} = \frac{N_{ij}(T)}{\int_{T}^{0}Y_i(s)ds}
where Y_{i}(s) is the number of firms in rating class i at time s and N_{ij}(T) is the total number of transitions over the period from i to j, where i \neq j.
Returns the following objects:
sampleTotals |
a list containing the following count components: |
totalsVec |
A vector of size 1-by-nRatings. For 'duration' calculations, the vector stores the total time spent on rating i. For 'cohort' calculations, the vector stores the initial counts (start vector) in rating i. |
totalsMat |
A matrix of size nRatings-by-nRatings. For 'duration' calculations, the matrix contains the total transitions observed out of rating i into rating j (all the diagonal elements are zero). For 'cohort' calculations, the matrix contains the total transitions observed from rating i to rating j. |
algorithm |
A character vector with values 'duration' or 'cohort'. |
transMat |
Matrix of transition probabilities in percent. The size of the transition matrix is nRatings-by-nRatings. |
genMat |
Generator Matrix. use only with duration method |
Abdoulaye (Ab) N'Diaye
Jafry, Y. and Schuermann, T. 2003 Metrics for Comparing Credit Migration Matrices, Wharton Financial Institutions Working Paper 03-08.
Lando, D., Skodeberg, T. M. 2002 Analyzing Rating Transitions and Rating Drift with Continuous Observations, Journal of Banking and Finance 26, No. 2-3, 423-444
MathWorld.com (2011). Matlab Central http://www.mathworks.com/matlabcentral/. Mathtools.net http://www.mathtools.net/.
Schuermann, T. and Hanson, S. 2004 Estimating Probabilities of Default, Staff Report No. 190, Federal Reserve Bank of New York,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | ## Not run:
#Example 1:
#When start date and end date are not specified, the entire dataset is used and the package
#performs TTC calculations. Equally when snapshots and interval are not specified the defaults
#are 1.
snapshots <- 0
interval <- 0
startDate <- 0
endDate <- 0
Example1<-TransitionProb(dataTM,startDate,endDate,'cohort', snapshots, interval)
#Example 2:
#using the duration method the time window of interest are specified 2-year period from the
#beginning of 2000 to the beginning of 2002 snapshots and interval are not specified.
snapshots <- 0
interval <- 0
startDate <- "2000-01-01"
endDate <- "2002-01-01"
Example2<-TransitionProb(dataTM,startDate, endDate,'duration', snapshots, interval)
#Example 3:
#using the cohort method the time window of interest are specified 5-year period from the
#beginning of 2000 to the beginning of 2005 snapshots and interval are not specified.
snapshots <- 0
interval <- 0
startDate <- "2000-01-01"
endDate <- "2005-01-01"
Example3<-TransitionProb(dataTM,startDate, endDate,'cohort', snapshots, interval)
#Example 4:
#assume that the time window of interest is the 5-year period from the beginning of 2000 to
#the beginning of 2005. We want to estimate 1-year transition probabilities using quarterly
#snapshots using cohort method.
snapshots <- 4 #This uses quarterly transition matrices
interval <- 1 #This gives a 1 year transition matrix
startDate <- "2000-01-01"
endDate <- "2005-01-01"
Example4<-TransitionProb(dataTM,startDate, endDate,'cohort', snapshots, interval)
#Example 5:
#assume that the time window of interest is the 5-year period from the beginning of 2000 to
#the beginning of 2005. We want to estimate a 2-year transition probabilities using quarterly
#snapshots using cohort method.
snapshots <- 4 #This uses quarterly transition matrices
interval <- 2 #This gives a 2 years transition matrix
startDate <- "2000-01-01"
endDate <- "2005-01-01"
Example5<-TransitionProb(dataTM,startDate, endDate,'cohort', snapshots, interval)
#Example 6:
#assume that the time window of interest is the 2-year period from the beginning of 2000 to
#the beginning of 2005. We want to estimate 1-year transition probabilities using quarterly
#snapshots using duration method.
snapshots <- 4 #This uses quarterly transition matrices
interval <- 1 #This gives a 1 year transition matrix
startDate <- "2000-01-01"
endDate <- "2002-01-01"
Example6<-TransitionProb(dataTM,startDate, endDate,'duration', snapshots, interval)
#Example 7:
#assume that the time window of interest is the 5-year period from the beginning of 2000 to
#the beginning of 2005. We want to estimate 1-year transition probabilities using monthly
#snapshots using cohort method.
snapshots <- 12 #This uses monthly transition matrices
interval <- 1 #This gives a 1 year transition matrix
startDate <- "2000-01-01"
endDate <- "2005-01-01"
Example7<-TransitionProb(dataTM,startDate, endDate,'cohort', snapshots, interval)
#Example 8:
#assume that the time window of interest is the 5-year period from the beginning of 2000 to
#the beginning of 2005. We want to estimate 1-year transition probabilities using annual
#snapshots using cohort method.
snapshots <- 1 #This uses annual transition matrices
interval <- 1 #This gives a 1 year transition matrix
startDate <- "2000-01-01"
endDate <- "2005-01-01"
Example8<-TransitionProb(dataTM,startDate, endDate,'cohort', snapshots, interval)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.