CalDelta {aihuman}R Documentation

Calculate the delta given the principal stratum

Description

Calculate the maximal deviation of decisions probability among the distributions for different groups (delta) given the principal stratum (R).

Usage

CalDelta(r, k, pd0, pd1, attr)

Arguments

r

The given principal stratum.

k

The maximum decision (e.g., largest bail amount).

pd0

P.D0.mcmc array generated from CalAPCE or CalAPCEparallel.

pd1

P.D1.mcmc array generated from CalAPCE or CalAPCEparallel.

attr

The index of subgroups (within the output of CalAPCE/CalAPCEparallel) that corresponds to the protected attributes.

Value

A data.frame of the delta.

Examples


data(synth)
subgroup_synth = list(1:nrow(synth), which(synth$Sex==0), which(synth$Sex==1), 
                      which(synth$Sex==1&synth$White==0), which(synth$Sex==1&synth$White==1))
sample_mcmc = AiEvalmcmc(data = synth, n.mcmc = 10)
sample_apce = CalAPCE(data = synth, mcmc.re = sample_mcmc, subgroup = subgroup_synth, 
                      burnin = 0)
CalDelta(0, 3, sample_apce[["P.D0.mcmc"]], sample_apce[["P.D1.mcmc"]], c(2,3))



[Package aihuman version 0.1.0 Index]