Skip to contents

Mean over template words of the variance over groups of log(p / prior). ddof = 0 is numpy's POPULATION variance.

Usage

morie_kamath_ch6_cbs_variance(W, A, p_a, p_prior, ddof = 0)

Arguments

W

Template words.

A

Social groups.

p_a, p_prior

|W| x |A| probability matrices.

ddof

Default 0.

Value

List with estimate, per_word, log_ratios.

Examples

morie_kamath_ch6_cbs_variance(c("w1", "w2"), c("g1", "g2"), matrix(c(0.6,
    0.3, 0.4, 0.7), 2), matrix(0.5, 2, 2))
#> $estimate
#> [1] 0.1102895
#> 
#> $per_word
#> [1] 0.04110049 0.17947842
#> 
#> $log_ratios
#>            [,1]       [,2]
#> [1,]  0.1823216 -0.2231436
#> [2,] -0.5108256  0.3364722
#> 
#> $ddof
#> [1] 0
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "Categorical Bias Score (Kamath Eq 6.9)"
#>