Skip to contents

q_i = Phi^-1((i + 0.5)/n) plus the max-normalised levels and bin widths.

Usage

morie_kamath_nf4_datatype(n_bins = 16)

morie_kamath_normal_quantile(u)

Arguments

n_bins

Levels; 16 gives NF4.

u

Probabilities strictly inside (0, 1).

Value

List with levels, normalized, bin_widths, n_bits.

Examples

morie_kamath_nf4_datatype()
#> $levels
#>  [1] -1.86273187 -1.31801090 -1.00999017 -0.77642176 -0.57913216 -0.40225007
#>  [7] -0.23720211 -0.07841241  0.07841241  0.23720211  0.40225007  0.57913216
#> [13]  0.77642176  1.00999017  1.31801090  1.86273187
#> 
#> $normalized
#>  [1] -1.00000000 -0.70756877 -0.54220910 -0.41681885 -0.31090474 -0.21594631
#>  [7] -0.12734098 -0.04209538  0.04209538  0.12734098  0.21594631  0.31090474
#> [13]  0.41681885  0.54220910  0.70756877  1.00000000
#> 
#> $bin_widths
#>  [1] 0.5447210 0.3080207 0.2335684 0.1972896 0.1768821 0.1650480 0.1587897
#>  [8] 0.1568248 0.1587897 0.1650480 0.1768821 0.1972896 0.2335684 0.3080207
#> [15] 0.5447210
#> 
#> $n_bits
#> [1] 4
#> 
#> $estimate
#> [1] 1.862732
#> 
#> $n
#> [1] 16
#> 
#> $method
#> [1] "NF4 equal-mass normal quantile grid"
#>