mkPenaltyFun: Make penalty function

Description Usage Arguments Value Examples

Description

Make penalty function

Usage

1
2
3
4
5
mkPenaltyFun(penCovar, penFixef, penLoads, env = environment())

mkPenLpNorm(p = 2, lambda = 1)

mkPenPareto(alpha = 3, beta = 1)

Arguments

penCovar,penFixef,penLoads

Penalty functions for covariance, fixed effects, and loadings parameters. Can be NULL.

env

Environment in which to evaluate the resulting function.

p

exponent of the L-p norm

lambda

multiplier for the penalty term

alpha,beta

parameters of the generalized double Pareto distribution (defaults from Murray et al 2013, JASA)

Value

A function with two arguments:

pars

Parameter vector

parInds

Named list of indices pointing to the elements of pars corresponding to one of the three parameter types. The names of this list must include covar, fixef, and/or loads if the correponding type has a supplied (i.e. non-null) penalty function.

Examples

1
2
3
4
penCovar <- function(x) x^2
penFixef <- NULL
penLoads <- function(gg) abs(gg) + 10
mkPenaltyFun(penCovar, penFixef, penLoads)(1:10, list(covar = 1:5, loads = 6:10))

stevencarlislewalker/lme4ord documentation built on May 30, 2019, 4:43 p.m.