get_safe_log_h_hp: Asymptotic log of 'h' and 'hp' functions for large 'x' for...

View source: R/genscore.R

get_safe_log_h_hpR Documentation

Asymptotic log of h and hp functions for large x for modes with an unbounded h.

Description

Asymptotic log of h and hp functions for large x for modes with an unbounded h.

Usage

get_safe_log_h_hp(mode, para)

Arguments

mode

A string, the class of the h function. Must be one of "asinh", "cosh", "exp", "identity", "log_pow", "pow", "sinh", "softplus", and "tanh".

para

A number, the first parameter to the h function.

Value

A list of two vectorized functions, logh and loghp.

Examples

para <- 2.3
x <- seq(from=0.1, to=150, by=0.1)
for (mode in c("asinh", "cosh", "exp", "identity", "log_pow", "pow", "sinh", "softplus", "tanh")) {
  print(mode)
  hx_hpx <- get_h_hp(mode, para)(x)
  print(c(max(abs(get_safe_log_h_hp(mode, para)$logh(x) - log(hx_hpx$hx))), 
          max(abs(get_safe_log_h_hp(mode, para)$loghp(x) - log(hx_hpx$hpx)))))
}

genscore documentation built on May 29, 2024, 9 a.m.