@@ -31,26 +31,26 @@ function start_fabin3(observed::SemObservedMissing, imply, optimizer, args...; k
3131end
3232
3333function start_fabin3 (ram_matrices:: RAMMatrices , Σ, μ)
34- A_ind, S_ind, F_ind, M_ind, params = ram_matrices. A_ind,
34+ A_ind, S_ind, F_ind, M_ind, n_par = ram_matrices. A_ind,
3535 ram_matrices. S_ind,
3636 ram_matrices. F_ind,
3737 ram_matrices. M_ind,
38- ram_matrices. params
38+ nparams ( ram_matrices)
3939
40- n_par = length (params)
4140 start_val = zeros (n_par)
42- n_var, n_nod = ram_matrices. size_F
43- n_latent = n_nod - n_var
41+ n_obs = nobserved_vars (ram_matrices)
42+ n_var = nvars (ram_matrices)
43+ n_latent = nlatent_vars (ram_matrices)
4444
45- C_indices = CartesianIndices ((n_nod, n_nod ))
45+ C_indices = CartesianIndices ((n_var, n_var ))
4646
4747 # check in which matrix each parameter appears
4848
4949 indices = Vector {CartesianIndex{2}} (undef, n_par)
5050
5151 #= in_S = length.(S_ind) .!= 0
5252 in_A = length.(A_ind) .!= 0
53- A_ind_c = [linear2cartesian(ind, (n_nod, n_nod )) for ind in A_ind]
53+ A_ind_c = [linear2cartesian(ind, (n_var, n_var )) for ind in A_ind]
5454 in_Λ = [any(ind[2] .∈ F_ind) for ind in A_ind_c]
5555
5656 if !isnothing(M)
@@ -77,7 +77,7 @@ function start_fabin3(ram_matrices::RAMMatrices, Σ, μ)
7777
7878 # set loadings
7979 constants = ram_matrices. constants
80- A_ind_c = [linear2cartesian (ind, (n_nod, n_nod )) for ind in A_ind]
80+ A_ind_c = [linear2cartesian (ind, (n_var, n_var )) for ind in A_ind]
8181 # ind_Λ = findall([is_in_Λ(ind_vec, F_ind) for ind_vec in A_ind_c])
8282
8383 function calculate_lambda (
@@ -99,7 +99,7 @@ function start_fabin3(ram_matrices::RAMMatrices, Σ, μ)
9999 end
100100 end
101101
102- for i in setdiff (1 : n_nod , F_ind)
102+ for i in setdiff (1 : n_var , F_ind)
103103 reference = Int64[]
104104 indicators = Int64[]
105105 indicator2parampos = Dict {Int, Int} ()
0 commit comments