File tree Expand file tree Collapse file tree 4 files changed +31
-30
lines changed Expand file tree Collapse file tree 4 files changed +31
-30
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ include("observed/missing.jl")
5050include (" frontend/specification/Sem.jl" )
5151include (" frontend/specification/documentation.jl" )
5252# imply
53+ include (" imply/abstract.jl" )
5354include (" imply/RAM/symbolic.jl" )
5455include (" imply/RAM/generic.jl" )
5556include (" imply/empty.jl" )
Original file line number Diff line number Diff line change @@ -202,37 +202,10 @@ end
202202# ## Recommended methods
203203# ###########################################################################################
204204
205- params (imply:: RAM ) = params (imply. ram_matrices)
206- nparams (imply:: RAM ) = nparams (imply. ram_matrices)
207-
208205function update_observed (imply:: RAM , observed:: SemObserved ; kwargs... )
209206 if n_man (observed) == size (imply. Σ, 1 )
210207 return imply
211208 else
212209 return RAM (; observed = observed, kwargs... )
213210 end
214211end
215-
216- # ###########################################################################################
217- # ## additional functions
218- # ###########################################################################################
219-
220- function check_acyclic (A:: AbstractMatrix )
221- # check if the model is acyclic
222- acyclic = isone (det (I - A))
223-
224- # check if A is lower or upper triangular
225- if istril (A)
226- @info " A matrix is lower triangular"
227- return LowerTriangular (A)
228- elseif istriu (A)
229- @info " A matrix is upper triangular"
230- return UpperTriangular (A)
231- else
232- if acyclic
233- @info " Your model is acyclic, specifying the A Matrix as either Upper or Lower Triangular can have great performance benefits.\n " maxlog =
234- 1
235- end
236- return A
237- end
238- end
Original file line number Diff line number Diff line change 220220# ## Recommended methods
221221# ###########################################################################################
222222
223- params (imply:: RAMSymbolic ) = params (imply. ram_matrices)
224- nparams (imply:: RAMSymbolic ) = nparams (imply. ram_matrices)
225-
226223function update_observed (imply:: RAMSymbolic , observed:: SemObserved ; kwargs... )
227224 if n_man (observed) == size (imply. Σ, 1 )
228225 return imply
Original file line number Diff line number Diff line change 1+
2+ vars (imply:: SemImply ) = vars (imply. ram_matrices)
3+ observed_vars (imply:: SemImply ) = observed_vars (imply. ram_matrices)
4+ latent_vars (imply:: SemImply ) = latent_vars (imply. ram_matrices)
5+
6+ nvars (imply:: SemImply ) = nvars (imply. ram_matrices)
7+ nobserved_vars (imply:: SemImply ) = nobserved_vars (imply. ram_matrices)
8+ nlatent_vars (imply:: SemImply ) = nlatent_vars (imply. ram_matrices)
9+
10+ params (imply:: SemImply ) = params (imply. ram_matrices)
11+ nparams (imply:: SemImply ) = nparams (imply. ram_matrices)
12+
13+ function check_acyclic (A:: AbstractMatrix )
14+ # check if the model is acyclic
15+ acyclic = isone (det (I- A))
16+
17+ # check if A is lower or upper triangular
18+ if istril (A)
19+ @info " A matrix is lower triangular"
20+ return LowerTriangular (A)
21+ elseif istriu (A)
22+ @info " A matrix is upper triangular"
23+ return UpperTriangular (A)
24+ else
25+ if acyclic
26+ @info " Your model is acyclic, specifying the A Matrix as either Upper or Lower Triangular can have great performance benefits.\n " maxlog= 1
27+ end
28+ return A
29+ end
30+ end
You can’t perform that action at this time.
0 commit comments