get_h_hp_vector: Generator of h and hp (derivative of h) functions.

Description Usage Arguments Details Value Examples

View source: R/genscore.R

Description

Generator of h and hp (derivative of h) functions.

Usage

1
get_h_hp_vector(mode, para = NULL, para2 = NULL)

Arguments

mode

A string, see details.

para

May be optional. A number, the first parameter. Default to NULL.

para2

May be optional. A number, the second parameter. Default to NULL.

Details

Helper function of get_h_hp(). Please refer to get_hs_hp().

Value

A function that returns a matrix with hx=h(x) (element-wise) and hpx=hp(x) (element-wise derivative of h) cbinded when applied to a vector or a matrix x, where if x is a vector, the returned value will have two columns and number of rows equal to length(x), otherwise it will have the same number of rows as x and number of columns doubled.

Examples

1
2
3
4
get_h_hp_vector("mcp", 2, 4)
get_h_hp_vector("min_log_pow", 1, log(1+3))
get_h_hp_vector("min_pow", 1, 3)
get_h_hp_vector("min_softplus")

genscore documentation built on April 28, 2020, 1:06 a.m.