getcal {SPARRAfairness}R Documentation

getcal()

Description

Produces a set of points for a calibration plot.

Usage

getcal(
  y,
  ypred,
  n = 10,
  kernel = FALSE,
  kernel_sd = 0.05,
  alpha = 0.05,
  c0 = 0,
  c2 = 0.1
)

Arguments

y

class labels, 0/1 or logical

ypred

predictions Pr(Y=1), numeric vector

n

number of subintervals/points

kernel

set to TRUE to use kernel method

kernel_sd

kernel width for kernel method; see above

alpha

return a pointwise confidence envolope for conservative 1-alpha confidence interval

c0

for computing maximum bias; assume true covariance function is of the form a0+ a1x + a2x^2, with |a0|<c0, |a2|<c2 (c1 does not matter)

c2

for computing maximum bias; assume true covariance function is of the form a0+ a1x + a2x^2, with |a0|<c0, |a2|<c2 (c1 does not matter)

Details

Uses either a binning method or a kernel method to determine height of points.

In both methods, considers n equally spaced subintervals of (0,1)

Value

a list with components x (expected calibration), y (observed calibration), n (number of samples in bins, if relevant), lower/upper (confidence interval on y)

Examples

# See vignette

[Package SPARRAfairness version 0.0.0.1 Index]