Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Unified Hierarchy of Models and their names #91

Open
aaronpeikert opened this issue May 3, 2023 · 13 comments
Open

Create Unified Hierarchy of Models and their names #91

aaronpeikert opened this issue May 3, 2023 · 13 comments

Comments

@aaronpeikert
Copy link
Contributor

related #32 #82

@LeonieHagitte
Copy link
Collaborator

LeonieHagitte commented May 12, 2023

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
Copy link
Collaborator

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
Copy link
Contributor Author

Can you write it as:

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

?

@aaronpeikert
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@valentinkm
Copy link
Collaborator

image

@aaronpeikert
Copy link
Contributor Author

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
Copy link
Contributor Author

Easy right 🤣

@LeonieHagitte
Copy link
Collaborator

'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
Copy link
Contributor Author

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
Copy link
Collaborator

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants