get_h_hp_adaptive {genscore} | R Documentation |
Generator of adaptive h and hp (derivative of h) functions.
Description
Generator of adaptive h
and hp
(derivative of h
) functions.
Usage
get_h_hp_adaptive(mode, para, percentile)
Arguments
mode |
A string, the corresponding mode (with the suffix |
para |
Must be provided, but can be |
percentile |
A number, the percentile for column-wise truncation on |
Details
Helper function of get_h_hp()
. Please refer to get_hs_hp()
.
Value
A function that returns a list containing hx=h(x)
(element-wise) and hpx=hp(x)
(element-wise derivative of h
) when applied to a matrix x
, with both of the results having the same shape as x
.
Examples
get_h_hp_adaptive("min_log_pow", 1, 0.4)(matrix(0:49, nrow=10))
get_h_hp_adaptive("min_pow", 2, 0.3)(matrix(0:49, nrow=10))
get_h_hp_adaptive("min_softplus", 2, 0.6)(matrix(seq(0, 0.49, by=0.01), nrow=10))
hx_hpx <- get_h_hp_adaptive("min_log_pow", 1, 0.4)(matrix(0:49, nrow=10))
hx_hpx2 <- get_h_hp("min_log_pow_ada", 1, 0.4)(matrix(0:49, nrow=10))
c(max(abs(hx_hpx$hx - hx_hpx2$hx)), max(abs(hx_hpx$hpx - hx_hpx2$hpx)))
[Package genscore version 1.0.2.2 Index]