Skip to content

Commit 1d09799

Browse files
Alexey Stukalovalyst
authored andcommitted
variance_params(SEMSpec)
1 parent 318560c commit 1d09799

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/frontend/specification/ParameterTable.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,18 @@ function update_se_hessian!(
378378
return update_partable!(partable, :se, params(fit), se)
379379
end
380380

381+
function variance_params(partable::ParameterTable)
382+
res = [
383+
param for (param, rel, from, to) in zip(
384+
partable.columns.param,
385+
partable.columns.relation,
386+
partable.columns.from,
387+
partable.columns.to,
388+
) if (rel == :) && (from == to)
389+
]
390+
unique!(res)
391+
end
392+
381393
"""
382394
param_values!(out::AbstractVector, partable::ParameterTable,
383395
col::Symbol = :estimate)

src/frontend/specification/RAMMatrices.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ function latent_vars(ram::RAMMatrices)
6363
end
6464
end
6565

66+
function variance_params(ram::RAMMatrices)
67+
S_diaginds = Set(diagind(ram.S))
68+
varparams = Vector{Symbol}()
69+
for (i, param) in enumerate(ram.params)
70+
if any((S_diaginds), param_occurences(ram.S, i))
71+
push!(varparams, param)
72+
end
73+
end
74+
return unique!(varparams)
75+
end
76+
6677
############################################################################################
6778
### Constructor
6879
############################################################################################

0 commit comments

Comments
 (0)