Open aaronpeikert opened 1 year ago
We thought of the following structure:
Taxon (lvl1)
pathmodels (#relations btw. manif. variables)(lvl2)
cfa (#relations of lat onto manif. var, which are not correlated) general sem (#combination of both) (lvl2)
simple cfa( #as part of cfa #81 #standalone factor) (lvl3)
hierarch. cfa( #as part of cfa) (lvl3)
Longit. mods (#as oart of general sem) (lvl3)
cross-sect. models(#a part of general sem) (lvl3)
Whether it is important to differentiate between hierarchical and non hierarchical cfas, we are uncertain. It would also be possible to differentiate only via taxons in the struct etc./ new labels for the secondorder factors etc. What is the general opinion on this?
Can you write it as:
abstract type Taxon end
struct PathModel <: Taxon end
abstract type SEM <: Taxon end
struct CFA <: SEM end
?
Whether it is important to differentiate between hierarchical and non hierarchical cfas, we are uncertain. It would also be possible to differentiate only via taxons in the struct etc./ new labels for the secondorder factors etc. What is the general opinion on this?
I think it makes sense to differentiate CFA types. Consider Hierachical vs Bifactor:
Also consider: https://openmx.ssri.psu.edu/wiki/modeltypes
Very good! Now, change the Taxonomy package in a PR so that:
using Taxonomy, AbstractTrees
AbstractTrees.children(d::DataType) = subtypes(d)
print_tree(Taxonomy.Taxon)
Taxon
├─ LGCM
├─ NoTaxon
├─ AbstractFactor
│ └─ Factor
└─ Pathmodel
└─ CFA
is representing this structure.
Easy right :rofl:
'abstract type Taxon end abstract type NoTaxon end struct PathModel <: Taxon end struct CFA <: Taxon end struct General_SEM <: Taxon end struct simple_CFA <: CFA end struct hierarchical_CFA <: CFA end struct longitudinal_SEM <: General_SEM end struct crosssectional_SEM <: General_SEM end'
Learn about CamelCase:
Learn about abstract vs concrete:
abstract type IAmAbstract end
struct IamConcrete end
# works:
struct SubType <: IAmAbstract end
# doesn't work:
struct SubType <: IAmConcrete end
https://docs.julialang.org/en/v1/manual/types/#man-abstract-types
okay this changes things :)
abstract type Taxon end abstract type NoTaxon end struct PathModel <: Taxon end abstract type CFA <: Taxon end abstract type General_SEM <: Taxon end struct simple_CFA <: CFA end struct hierarchical_CFA <: CFA end struct longitudinal_SEM <: General_SEM end struct crosssectional_SEM <: General_SEM end'
Great, now only CamelCase: https://docs.julialang.org/en/v1/manual/style-guide/#Use-naming-conventions-consistent-with-Julia-base/
e.g.: hierarchical_CFA
-> HierachicalCFA
Also, I suggest renaming General_SEM
to AbstractSEM
.
You may take insperation from other packages regarding naming, e.g., this is how stenograph looks:
julia> print_tree(StenoGraphs.AbstractEdge)
AbstractEdge
├─ Edge
│ ├─ DirectedEdge
│ └─ UndirectedEdge
└─ MetaEdge
├─ Arrow
└─ ModifiedEdge
julia> print_tree(StenoGraphs.AbstractNode)
AbstractNode
├─ MetaNode
│ ├─ ModifiedNode
│ └─ ModifyingNode
└─ Node
└─ SimpleNode
related #32 #82