Learn R Programming

robustlmm (version 1.4-2)

psiFuncCached: psiFuncCached constructor

Description

Create psi_func_cached object using cached numerical integration for E... slots.

Usage

psiFuncCached(rho, psi, wgt, Dwgt, Dpsi, name = NULL,
    ...)

Arguments

rho
rho-function
psi
psi-function
wgt
wgt-function
Dwgt
derivative of weight function
Dpsi
derivative of psi
name
descriptor of this function family
...
default values for tuning constants

Value

  • psi_func_cached-class object

Warning

the E... slots will not be fully functional: they just return the value for the current defaults and ignore their arguments.

See Also

psi_func_cached-class

Examples

Run this code
## re-define cPsi as psiFuncCached.
F0 <- function(x=1, .) rep.int(0, length(x))
F1 <- function(x=1, .) rep.int(1, length(x))
cPsi2 <- psiFuncCached(rho = function(x, .) x^2 / 2,
                       psi = function(x, .) x,
                       wgt = F1, Dwgt = F0, Dpsi = F1,
                       name = "classic (x^2/2)",
                       . = Inf ## dummy, need at least one parameter
                       )
stopifnot(all.equal(cPsi@Erho(), cPsi2@Erho()),
          all.equal(cPsi@Epsi2(), cPsi2@Epsi2()),
          all.equal(cPsi@EDpsi(), cPsi2@EDpsi()))

Run the code above in your browser using DataLab