get_h_hp_vector {genscore}R Documentation

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

Description

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

Usage

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

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")

[Package genscore version 1.0.2.2 Index]