formal-methods-mpi / Taxonomy.jl

Develop a Taxonomy of SEM
MIT License
2 stars 2 forks source link

Create Unified Hierarchy of Models and their names #91

Open aaronpeikert opened 1 year ago

aaronpeikert commented 1 year ago

related #32 #82

LeonieHagitte commented 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)

LeonieHagitte commented 1 year ago

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?

aaronpeikert commented 1 year ago

Can you write it as:

abstract type Taxon end
struct PathModel <: Taxon end
abstract type SEM <: Taxon end
struct CFA <: SEM end

?

aaronpeikert commented 1 year ago

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:

aaronpeikert commented 1 year ago

Also consider: https://openmx.ssri.psu.edu/wiki/modeltypes

valentinkm commented 1 year ago

image

aaronpeikert commented 1 year ago

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.

aaronpeikert commented 1 year ago

Easy right :rofl:

LeonieHagitte commented 1 year ago

'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'

aaronpeikert commented 1 year ago

Learn about CamelCase:

https://docs.julialang.org/en/v1/manual/style-guide/#Use-naming-conventions-consistent-with-Julia-base/

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

LeonieHagitte commented 1 year ago

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'

aaronpeikert commented 1 year ago

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.

aaronpeikert commented 1 year ago

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