The penfaModel class gives the internal matrix
representation of a factor analysis model. Note that this representation
summarizes the characteristics of the model itself (e.g., number of items,
number of factors, parameter indices, etc), without information on the
penalization process (see penfaPenalty for that
aspect). This class is an adaptation of the lavModel class from the
lavaan package.
GLISTList. The model matrices and vectors: "lambda" for the factor loading matrix, "psi" for the covariance matrix of the unique factors, "phi" for the covariance matrix of the common factors, "tau" for the intercept vector, and "kappa" for the vector of factor means. In case of a multiple-group analysis, the elements of each group are presented sequentially.
dimNamesList. Dimension names (row names and column names) of every model matrix and vector.
isSymmetricLogical vector declaring whether each model matrix/vector is symmetric.
mmSizeInteger vector specifying the size (unique elements only) of each model matrix/vector.
meanstructureLogical. It declares whether the model includes a meanstructure.
ngroupsInteger. The number of groups.
nmatInteger vector specifying the number of model matrices/vectors for each group.
nvarInteger vector specifying the number of observed variables in each group.
num.idxList of the indices of the observed variables in each group.
nx.freeInteger. The number of parameters of the factor model. This
count does not include the fixed parameters, but it does include the
parameters that will be penalized (if any) during optimization. (see
penfaPenalty for additional details in this respect).
nx.userInteger. The total count of the parameters that are being estimated and the ones that have been fixed.
m.free.idxList. For each model matrix, the indices of the elements to be estimated (i.e., non-fixed). The counter starts at 1 for every model matrix.
x.free.idxList. For each model matrix, the indices of the elements to be estimated (i.e., non-fixed). The counter continues from the previous model matrix.
m.user.idxList. Much like m.free.idx, but it also contains the
indices of the parameters that have been fixed by the user.
x.user.idxList. Much like x.free.idx, but it also contains the
indices of the parameters that have been fixed by the user.
x.free.var.idxVector of integers denoting the indices corresponding to the unique variances.
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@Model#> An object of class "penfaModel" #> Slot "GLIST": #> $lambda #> [,1] [,2] #> [1,] 7.658121e-01 0.000000e+00 #> [2,] 8.579551e-01 -1.287100e-05 #> [3,] 7.753391e-01 5.304850e-06 #> [4,] 9.208458e-01 -4.119937e-02 #> [5,] 8.096618e-01 5.262033e-02 #> [6,] 7.820608e-01 1.042524e-01 #> [7,] 5.230518e-01 3.412021e-01 #> [8,] 0.000000e+00 8.507219e-01 #> [9,] 4.013798e-05 8.714683e-01 #> [10,] 2.389271e-05 8.418956e-01 #> [11,] 8.563583e-07 8.429135e-01 #> [12,] -9.202527e-07 8.047512e-01 #> #> $psi #> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 0.3875064 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [2,] 0.0000000 0.2331226 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [3,] 0.0000000 0.0000000 0.3723067 0.0000000 0.0000000 0.0000000 0.0000000 #> [4,] 0.0000000 0.0000000 0.0000000 0.1844461 0.0000000 0.0000000 0.0000000 #> [5,] 0.0000000 0.0000000 0.0000000 0.0000000 0.2349729 0.0000000 0.0000000 #> [6,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.2009585 0.0000000 #> [7,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.2638821 #> [8,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [9,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [10,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [11,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [12,] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 #> [,8] [,9] [,10] [,11] [,12] #> [1,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [2,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [3,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [4,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [5,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [6,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [7,] 0.0000000 0.0000000 0.0000000 0.000000 0.0000000 #> [8,] 0.2454065 0.0000000 0.0000000 0.000000 0.0000000 #> [9,] 0.0000000 0.2083625 0.0000000 0.000000 0.0000000 #> [10,] 0.0000000 0.0000000 0.2607043 0.000000 0.0000000 #> [11,] 0.0000000 0.0000000 0.0000000 0.259044 0.0000000 #> [12,] 0.0000000 0.0000000 0.0000000 0.000000 0.3240195 #> #> $phi #> [,1] [,2] #> [1,] 1.0000000 0.8771535 #> [2,] 0.8771535 1.0000000 #> #> #> Slot "dimNames": #> [[1]] #> [[1]][[1]] #> [1] "h1" "h2" "h3" "h4" "h5" "h6" "h7" "v1" "v2" "v3" "v4" "v5" #> #> [[1]][[2]] #> [1] "help" "voice" #> #> #> [[2]] #> [[2]][[1]] #> [1] "h1" "h2" "h3" "h4" "h5" "h6" "h7" "v1" "v2" "v3" "v4" "v5" #> #> [[2]][[2]] #> [1] "h1" "h2" "h3" "h4" "h5" "h6" "h7" "v1" "v2" "v3" "v4" "v5" #> #> #> [[3]] #> [[3]][[1]] #> [1] "help" "voice" #> #> [[3]][[2]] #> [1] "help" "voice" #> #> #> #> Slot "isSymmetric": #> [1] FALSE TRUE TRUE #> #> Slot "mmSize": #> [1] 24 78 3 #> #> Slot "meanstructure": #> [1] FALSE #> #> Slot "ngroups": #> [1] 1 #> #> Slot "nmat": #> [1] 3 #> #> Slot "nvar": #> [1] 12 #> #> Slot "num.idx": #> [[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 #> #> #> Slot "nx.free": #> [1] 35 #> #> Slot "nx.user": #> [1] 39 #> #> Slot "m.free.idx": #> [[1]] #> [1] 1 2 3 4 5 6 7 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 #> #> [[2]] #> [1] 1 14 27 40 53 66 79 92 105 118 131 144 #> #> [[3]] #> [1] 2 3 #> #> #> Slot "x.free.idx": #> [[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #> #> [[2]] #> [1] 23 24 25 26 27 28 29 30 31 32 33 34 #> #> [[3]] #> [1] 35 35 #> #> #> Slot "m.user.idx": #> [[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #> #> [[2]] #> [1] 1 14 27 40 53 66 79 92 105 118 131 144 #> #> [[3]] #> [1] 1 2 3 4 #> #> #> Slot "x.user.idx": #> [[1]] #> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #> #> [[2]] #> [1] 25 26 27 28 29 30 31 32 33 34 35 36 #> #> [[3]] #> [1] 37 39 39 38 #> #> #> Slot "x.free.var.idx": #> [1] 23 24 25 26 27 28 29 30 31 32 33 34 #>