cancelPenalty: Remove penalty from a penalized latent variable model

Description Usage Arguments Details Examples

Description

Remove one or several penalties from a penalized latent variable model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cancelPenalty(x, ...)

cancelPenalty(x, ...) <- value

## S3 method for class 'plvm'
cancelPenalty(x, ..., value)

## S3 replacement method for class 'plvm'
cancelPenalty(x, ...) <- value

## S3 replacement method for class 'penaltyL12'
cancelPenalty(x, extraParameter, rm.lasso = TRUE,
  rm.ridge = TRUE, rm.groupLasso = TRUE) <- value

Arguments

x

plvm-object

...

additional arguments to be passed to lower level functions

value

the penalty that should be removed

extraParameter

external parameters

rm.lasso

should lasso penalties be removed?

rm.ridge

should ridge penalties be removed?

rm.groupLasso

should group lasso penalties be removed?

Details

Since lavaReduce::initVar_links does not work for the external parameters, they have to be handled separately.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## lasso
m <- lvm()
m <- regression(m, x=paste0("x",1:10),y="y")
pm <- penalize(m)

cancelPenalty(pm, value = "y~x5")
cancelPenalty(pm) <- y~x1
cancelPenalty(pm) <- c("y~x2","y~x3")
cancelPenalty(pm) <- penalty(pm, no.ridge = TRUE)$link
pm

## group lasso
m <- regression(m, x=paste0("x",1:10),y="y")
categorical(m, K = 3, labels = 1:3) <- ~x1
pm <- penalize(m)
pm
cancelPenalty(pm) <- "y~x2"
pm
cancelPenalty(pm) <- "y~x12"
pm
cancelPenalty(pm) <- penalty(pm, no.lasso = TRUE, no.ridge = TRUE)$link
pm

bozenne/lava.penalty documentation built on May 13, 2019, 1:41 a.m.