Skip to content

Commit 887763a

Browse files
Alexey Stukalovalyst
authored andcommitted
variance_params(SEMSpec)
1 parent 0a822ac commit 887763a

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
@@ -388,6 +388,18 @@ function update_se_hessian!(
388388
return update_partable!(partable, :se, params(fit), se)
389389
end
390390

391+
function variance_params(partable::ParameterTable)
392+
res = [
393+
param for (param, rel, from, to) in zip(
394+
partable.columns.param,
395+
partable.columns.relation,
396+
partable.columns.from,
397+
partable.columns.to,
398+
) if (rel == :) && (from == to)
399+
]
400+
unique!(res)
401+
end
402+
391403
"""
392404
param_values!(out::AbstractVector, partable::ParameterTable,
393405
col::Symbol = :estimate)

src/frontend/specification/RAMMatrices.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ function latent_vars(ram::RAMMatrices)
4444
end
4545
end
4646

47+
function variance_params(ram::RAMMatrices)
48+
S_diaginds = Set(diagind(ram.S))
49+
varparams = Vector{Symbol}()
50+
for (i, param) in enumerate(ram.params)
51+
if any((S_diaginds), param_occurences(ram.S, i))
52+
push!(varparams, param)
53+
end
54+
end
55+
return unique!(varparams)
56+
end
57+
4758
############################################################################################
4859
### Constructor
4960
############################################################################################

0 commit comments

Comments
 (0)