Description Usage Arguments Value Author(s) Examples
This model implements a forecasting method using Linear Discriminant Analysis.
1 2 | transForecast_lda(data, histData, predData_lda, startDate, endDate, method,
interval, snapshots, defind, depVar, indVars, pct, ratingCat)
|
data |
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. |
histData |
historical macroeconomic,financial and non-financial data. |
predData_lda |
forecasting data. |
startDate |
start date of the estimation time window, in string or numeric format. |
endDate |
end date of the estimation time window, in string or numeric format. |
method |
estimation algorithm, in string format. Valid values are 'duration' or 'cohort'. |
interval |
the length of the transition interval under consideration, in years. The default value is 1, i.e., 1-year transition probabilities are estimated. |
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. |
defind |
Default Indicator |
depVar |
dependent variable, as a string. |
indVars |
list containing the independent variables. |
pct |
percent of data used in training dataset. |
ratingCat |
list containing the unique rating caetgories |
The output consists of a forecasted transition matrix.
Abdoulaye (Ab) N'Diaye
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 | ## Not run:
library(dplyr)
library(plyr)
library(Matrix)
for (i in c(24, 25, 26)) {
data <- data
histData <- histData.normz
predData_lda2 <- predData_lda_Baseline
predData_lda2 <- subset(
predData_lda2,
X == i,
select = c(Market.Volatility.Index..Level..normz
)
)
indVars = c("Market.Volatility.Index..Level..normz"
)
startDate = "1991-08-16"
endDate = "2007-08-16"
depVar <- c("end_rating")
pct <- 1
wgt <- "mCount"
ratingCat <- c("A", "B", "C", "D", "E", "F", "G")
defind <- "G"
method = "cohort"
snapshots = 1
interval = 1
lda_TM <-
transForecast_lda(
data,
histData,
predData_lda2,
startDate,
endDate,
method,
interval,
snapshots,
defind,
depVar,
indVars,
pct,
ratingCat
)
print(lda_TM)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.