# クレジット移行リスク

PD =デフォルトの確率

LGD =デフォルトの損失

RWA =リスク加重資産

EL =予想損失

いくつかのデータを考慮して、2つの期間の間のリスク移行の範囲を特定する方法が本当にわかりません。実際、私はこれらの期間が連続しているかどうか、またはそれらがカバーする年についての情報を持っていません（多分それはあまり重要ではないかもしれません）。

If you have the data in two different tables, doing this in base R is quite easy. For example:

set.seed(1L)

N <- 100L
current <- data.frame(
ID = 1:100,
Rating = sample(1:5, N, replace = TRUE),
ECap = runif(N, 0, 1e6)
)

previous <- data.frame(
ID = 25:124,
Rating = sample(1:5, N, replace = TRUE),
ECap = runif(N, 0, 1e6)
)

merged <- merge(previous, current, by = 'ID')
# Change in ECap
merged$$ECap_delta <- merged$$ECap.y - merged$$ECap.x # Rating migrations table(merged$$Rating.y, merged\$Rating.x)


You'll also want to look at ID that are added or removed from the two sets.

The same steps can be done in SQL or Python as well.

You're right that Economic Capital (ECap) is related to Expected Loss, they both tell us something about the different the loss distribution. However, there is no function that takes you from one to the other directly.

• The Expected Loss is the expected value of the loss distribution $$F$$, i.e. $$\mathrm{E}(L) = \mathrm{E}(\mathrm{Loss})$$
• The ECap is an upper percentile $$\alpha$$ of the loss distribution, analogous to the Value at Risk, mathematically: $$\mathrm{ECap} = \inf\{x \in \mathbb{R} : F(x) > \alpha\}$$.