Description Usage Arguments Details Value Examples
A (helper) constructor to create objects of class bin. Each bin object inherits from the class list.
1 2 3 4 5 6 7 |
num_obl |
An integer representing the number of obligors (customers). This value must include both defaults and non-defaults. |
num_def |
An integer representing the number of defaults. The defaults is the stock of obligors that are (currently) in non-default state but defaults at least once in the next 12-month period (typically). |
min_score |
A double representing the minimum score. |
max_score |
A double representing the maximum score. |
... |
Optional parameters passed on to the constructor. Used internally to set is_merged to TRUE as part of the merge functionality. |
Validation is performed on the arguments before passing on the values to the constructor. Also, a print method exists for bin objects.
An object of class bin. The structure of each bin is the following
The number of obligors (customers).
The number of defaults.
The default rate.
The odds ratio.
The minimum score.
The midpoint score (simple average of min_score
and max_score
).
The maximum score.
A boolean. TRUE indicates the bin has been merged with other bins. FALSE implies the bin is identical to the initialized bin. The merged status is visible in the print() output of bin objects.
1 2 3 4 5 6 7 8 9 10 | # create a single bin object
single_bin <- bin(num_obl = 100, num_def = 5, min_score = 30, max_score = 60)
print(single_bin)
# create a list of bins
bins <- list(
bin(num_obl = 100, num_def = 5, min_score = 30, max_score = 60),
bin(num_obl = 200, num_def = 5, min_score = 61, max_score = 80)
)
print(bins)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.