null_gini: null_gini

Description Usage Arguments Value Examples

View source: R/null_gini.R

Description

Return the curve for a gini curve for threshold in the prediction. Need to plot gini curve

Note: Predictions should be annualised (independent of exposure)

Usage

1
null_gini(actual, predicted, weight = NULL, na.rm = FALSE)

Arguments

actual

Array[Numeric] - Values we are aiming to predict.

predicted

Array[Numeric] - Values that we have predicted.

weight

Optional: Array[Numeric] - Weighting of predictions. If NUll even weighting is used

na.rm

logical. Should missing values be removed?

Value

dataframe with columns prediction - value of predictions (sorted) cum_act - cumulative fraction of actuals cum_pop - cumulative fraction of weight

Examples

1
2
3
4
5
actual <- rnorm(100, mean=100, sd=10)
weight <- rep(1,100)
predicted <- actual + rnorm(100, mean=0, sd=1)

null_gini(actual, predicted, weight)

gloverd2/admr documentation built on Dec. 2, 2020, 11:16 p.m.