Description Usage Arguments Details Examples
initializeFactor.penaltyL12: update the lasso penalty to group lasso penalty in presence of categorical variables. initialize.penaltyL12: estimate starting value for the plvm. initialize.penaltyNuclear: estimate starting value for the plvm. initialize.start: estimate starting value for the plvm.
1 2 3 4 5 6 7 8 | initializeFactor.penaltyL12(x, data, trace)
initialize.penaltyL12(x, name.x, model.x, regularizationPath)
initialize.start(x, data, regularizationPath, increasing, constrain.variance,
name.variance, ...)
initializer.penaltyNuclear(x, name.coef)
|
x |
a penalized lvm model |
data |
a data.frame containing the data |
trace |
should the user be told that some penalties have been updated ? |
name.coef |
the name of the parameters |
Remove penalties corresponding to reference links
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #### initialize.data ####
#### initializeFactor.penaltyL12 ###
m <- lvm(Y~X1+X2+X3+X4)
pm <- penalize(m)
initializeFactor.penaltyL12(pm, data = sim(m, 1), trace = TRUE)
mCAT <- m
categorical(mCAT, K = 3, labels = letters[1:3]) <- "X1"
categorical(mCAT, K = 2, labels = letters[1:2]) <- "X2"
pm <- penalize(m)
initializeFactor.penaltyL12(pm, data = sim(mCAT, 1), trace = TRUE)
pmCAT <- penalize(mCAT)
initializeFactor.penaltyL12(pmCAT, data = sim(mCAT, 1), trace = TRUE)
#### initialize.penaltyL12 ####
m <- lvm()
regression(m) <- y1~x1+x2+x3+x4
#### elastic net
e <- estimate(m, sim(m, 1e2))
pm <- penalize(m, lambda1 = 2, lambda2 = 1.5)
pen12 <- initialize.penaltyL12(pm$penalty, name.coef = names(coef(e)))
pen12
i <- initializer.plvm(pm, data = sim(m, 1e2),
regularizationPath = FALSE, constrain.variance = FALSE)
#### group lasso
categorical(m, labels = c("A","B","C")) <- "x1"
categorical(m, labels = c("A","B","C")) <- "x2"
e <- estimate(m, sim(m, 1e2))
pm <- penalize(m, lambdaG = 5)
pen12 <- initializer.penaltyL12(pm$penalty, name.coef = names(coef(e)))
pen12
estimate(pm, data = sim(pm, 1e2))
i <- initializer.plvm(pm, data = sim(m, 1e2),
regularizationPath = FALSE, constrain.variance = FALSE)
# nuclear norm
m <- lvm()
coords <- expand.grid(x = 1:10, y = 1:10)
m <- regression(m, y = "y1", x = paste0("z",1:100))
mNuclear <- lvm(y1 ~ x1 + x2)
penalizeNuclear.penaltyL12(mNuclear, coords = coords, lambdaN = 10) <- coefReg(m, value = TRUE)
mNuclear
penN <- initializer.plvm(mNuclear$penaltyNuclear, name.coef = coef(mNuclear))
penN
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.