hhi: Herfindahl-Hirschman Index (HHI)

View source: R/28_HHI.R

hhiR Documentation

Herfindahl-Hirschman Index (HHI)

Description

hhi performs calculation on Herfindahl-Hirschman Index.

Usage

hhi(x)

Arguments

x

Numeric vector of input values (e.g. number of observations or sum of exposure per rating grade).

Value

The command hhinormal.test returns single element numeric vector of HHI value.

Examples

#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)

PDtoolkit documentation built on Sept. 20, 2023, 9:06 a.m.