The penfaPenalty
class provides information on the
penalization process, such as the user-specified penalty functions, the
optimal values of the tuning parameters, and the penalty matrices at
convergence.
strategy
Character. The strategy used for the selection of the tuning
parameter(s). If strategy = "auto"
, the optimal values of the tuning
parameters are determined via the automatic tuning parameter procedure; if
strategy = "fixed"
, a penalized factor model with the values of the
tuning parameters stored in the option eta
is estimated.
penalty
List. A list of the user-specified penalty functions for sparsity ("shrink") and parameter equivalence ("diff").
tuning
List. A named list containing the optimal values of the tuning
parameter(s) if strategy = "auto"
or the user-specified fixed
values of the tuning parameter(s) if strategy = "fixed"
. The list
has two components with names "shrink" and "diff", and refers to the tuning
parameters used for shrinkage and group equivalence, respectively. The
components of the list are, in turn, the named vectors specifying the type
of parameter matrices or vectors that were penalized.
pmat
List. A named list containing the names of the parameter matrices and vectors that were penalized for sparsity ("shrink") and/or group equivalence ("diff").
pen.idx
List. A named list with the indices of the parameters that were penalized for sparsity ("shrink") and/or group equivalence ("diff").
Sh.info
List. A list of the penalization terms, vectors and matrices
evaluated at the optimal values of the tuning parameters. In particular,
its argument S.h
returns the estimated penalty matrix. If the factor
model is penalized only through a shrinkage penalty (i.e.,
pen.shrink
is not 'none'
), and there is no penalization on
the differences (i.e., pen.diff = 'none'
), then S.h
is a
diagonal matrix whose elements precisely quantify the extent to which each
model parameter has been penalized.
extra
List. A list possibly containing additional information on the penalization process, such as the hyperparameter values for some penalty functions (e.g., for the alasso, the value of the exponent and the adaptive weights.)
automatic
List. If strategy = "auto"
, it contains information on
the automatic multiple tuning parameter procedure, such as the optimal
values of the tuning parameters, the convergence status, the specified
value of the influence factor, the number of necessary iterations, and the
tolerance level.
data(ccdata) syntax = 'help =~ h1 + h2 + h3 + h4 + h5 + h6 + h7 + 0*v1 + v2 + v3 + v4 + v5 voice =~ 0*h1 + h2 + h3 + h4 + h5 + h6 + h7 + v1 + v2 + v3 + v4 + v5' alasso_fit <- penfa(## factor model model = syntax, data = ccdata, std.lv = TRUE, ## penalization pen.shrink = "alasso", eta = list(shrink = c("lambda" = 0.01), diff = c("none" = 0)), ## automatic procedure strategy = "auto")#> Computing weights for alasso (ML estimates)... done. #> #> Automatic procedure: #> Iteration 1 : 0.00298271 #> Iteration 2 : 0.00452604 #> #> Largest absolute gradient value: 12.76355181 #> Fisher information matrix is positive definite #> Eigenvalue range: [180.2917, 9189645] #> Trust region iterations: 15 #> Factor solution: admissible #> Effective degrees of freedom: 27.12936alasso_fit@Penalize#> Strategy auto #> Influence factor 4 #> Number of two-steps (automatic) 2 #> #> Penalty function: #> Sparsity alasso #> #> Additional tuning parameter #> alasso 1 #> #> Optimal tuning parameter: #> Sparsity #> - Factor loadings 0.005 #>#> Formal class 'penfaPenalty' [package "penfa"] with 8 slots #> ..@ strategy : chr "auto" #> ..@ penalty :List of 2 #> .. ..$ shrink: chr "alasso" #> .. ..$ diff : chr "none" #> ..@ tuning :List of 2 #> .. ..$ shrink: Named num 0.00453 #> .. .. ..- attr(*, "names")= chr "lambda" #> .. ..$ diff : Named num 0 #> .. .. ..- attr(*, "names")= chr "none" #> ..@ pmat :List of 2 #> .. ..$ shrink: chr "lambda" #> .. ..$ diff : chr "none" #> ..@ pen.idx :List of 2 #> .. ..$ shrink:List of 1 #> .. .. ..$ lambda: int [1:22] 1 2 3 4 5 6 7 8 9 10 ... #> .. ..$ diff : list() #> ..@ Sh.info :List of 5 #> .. ..$ S.h1 : num [1, 1] 25.4 #> .. ..$ S.h2 : num [1:35, 1] 4.44 3.84 4.46 3.52 4.43 ... #> .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. .. .. ..$ : NULL #> .. ..$ S.h : 'penfaPenMat' num [1:35, 1:35] 5.8 0 0 0 0 ... #> .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. ..$ SS.shrink:List of 1 #> .. .. ..$ lambda: 'penfaPenMat' num [1:35, 1:35] 5.8 0 0 0 0 ... #> .. .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. ..$ SS.diff :List of 1 #> .. .. ..$ none: 'penfaPenMat' num [1:35, 1:35] 0 0 0 0 0 0 0 0 0 0 ... #> .. .. .. ..- attr(*, "dimnames")=List of 2 #> .. .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> .. .. .. .. ..$ : chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> ..@ extra :List of 2 #> .. ..$ a.alasso: num 1 #> .. ..$ weights : Named num [1:35] 0.782 0.905 0.779 0.986 0.783 ... #> .. .. ..- attr(*, "names")= chr [1:35] "help=~h1" "help=~h2" "help=~h3" "help=~h4" ... #> ..@ automatic:List of 8 #> .. ..$ optimal.eta: num 0.00453 #> .. ..$ conv : logi TRUE #> .. ..$ gamma : num 4 #> .. ..$ iter : num 2 #> .. ..$ iter.inner : num 43 #> .. ..$ iterlim : num 50 #> .. ..$ tol : num 1e-07 #> .. ..$ R : num [1:35, 1:35] -1.392 -1.033 -0.601 -0.106 0.522 ...