Learn R Programming

robustlmm (version 2.4-3)

psi-functions: Classical, Huber and smoothed Huber psi- or rho-functions

Description

\(\psi\)-functions are used by rlmer in the estimating equations and to compute robustness weights. Change tuning parameters using chgDefaults and convert to squared robustness weights using the psi2propII function.

Arguments

Details

The “classical” \(\psi\)-function cPsi can be used to get a non-robust, i.e., classical, fit. The psi slot equals the identity function, and the rho slot equals quadratic function. Accordingly, the robustness weights will always be 1 when using cPsi.

The Huber \(\psi\)-function huberPsiRcpp is identical to the one in the package robustbase. The psi slot equals the identity function within \(\pm k\) (where \(k\) is the tuning parameter). Outside this interval it is equal to \(\pm k\). The rho slot equals the quadratic function within \(\pm k\) and a linear function outside.

The smoothed Huber \(\psi\)-function is very similar to the regular Huber \(\psi\)-function. Instead of a sharp bend like the Huber function, the smoothe Huber function bends smoothly. The first tuning contant, k, can be compared to the tuning constant of the original Huber function. The second tuning constant, s, determines the smoothness of the bend.

See Also

chgDefaults and psi2propII for changing tuning parameters; psi_func-class for a more detailed description of the slots; PsiFunction C++ class for a base class to create custom \(\psi\)-functions.

Examples

Run this code
# NOT RUN {
plot(cPsi)
plot(huberPsiRcpp)
plot(smoothPsi)
curve(cPsi@psi(x), -3, 3)
curve(smoothPsi@psi(x), -3, 3, add=TRUE, col="red")
curve(huberPsiRcpp@psi(x), -3, 3, add=TRUE, col="blue")
# }

Run the code above in your browser using DataLab