hhi | R Documentation |
hhi
performs calculation on Herfindahl-Hirschman Index.
hhi(x)
x |
Numeric vector of input values (e.g. number of observations or sum of exposure per rating grade). |
The command hhinormal.test
returns single element numeric vector of HHI value.
#simulate PD model and rating scale
suppressMessages(library(PDtoolkit))
data(loans)
res <- stepFWDr(start.model = Creditability ~ 1,
p.value = 0.05,
db = loans)
mod.predictions <- unname(predict(res$model, type = "response"))
rating.scale <- sts.bin(y = loans$Creditability, x = mod.predictions)[[1]]
#calculate HHI
hhi(x = rating.scale$no)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.