-
Notifications
You must be signed in to change notification settings - Fork 6
Cleanup Variables API #207
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
Merged
Maximilian-Stefan-Ernst
merged 26 commits into
StructuralEquationModels:devel
from
alyst:vars_api
Jul 31, 2024
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
619d89a
common.jl: common vars API methods
alyst 6aa0fd9
SemSpecification: vars API
alyst 2e4784a
RAMMatrices: vars API
467c034
ParamTable: vars API
alyst d6b1449
SemImply: vars and params API
alyst 56e68e0
RAM imply: use vars API
e27f028
RAMSymbolic: use vars API
814d615
start_simple(): use vars API
0ac47b4
starts_fabin3: use vars API
0d45014
remove get_colnames()
09f5eca
remove get_n_nodes()
3161745
get_data() -> samples()
alyst 08044e1
SemObsData: remove rowwise
alyst 5c0c588
AbstractSemSingle: vars API
alyst 913964b
rename n_obs() -> nsamples()
alyst 35c0466
rename n_man() -> nobserved_vars()
alyst d22254c
move Sem methods out of types.jl
alyst 1b13c73
rows(::SemObservedMissing) -> pattern_rows()
alyst aec4358
fix formatting
alyst 95dc477
samples(SemObsCov) throws an exception
alyst 1f67019
SemObserved tests: refactor and add var API tests
alyst 3e9aac3
ParTable(graph): group is only valid for ensemble
alyst 7a07233
ParTable(graph): fix NaN modif detection
alyst c0e2c9e
export vars, params and observed APIs
alyst 86c172a
refactor SemSpec tests
alyst 2f6e8b7
add Sem unit tests
alyst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# API methods supported by multiple SEM.jl types | ||
|
||
""" | ||
nparams(semobj) | ||
|
||
Return the number of parameters in a SEM model associated with `semobj`. | ||
|
||
See also [`params`](@ref). | ||
""" | ||
nparams(semobj) = length(params(semobj)) | ||
|
||
""" | ||
nvars(semobj) | ||
|
||
Return the number of variables in a SEM model associated with `semobj`. | ||
|
||
See also [`vars`](@ref). | ||
""" | ||
nvars(semobj) = length(vars(semobj)) | ||
|
||
""" | ||
nobserved_vars(semobj) | ||
|
||
Return the number of observed variables in a SEM model associated with `semobj`. | ||
""" | ||
nobserved_vars(semobj) = length(observed_vars(semobj)) | ||
|
||
""" | ||
nlatent_vars(semobj) | ||
|
||
Return the number of latent variables in a SEM model associated with `semobj`. | ||
""" | ||
nlatent_vars(semobj) = length(latent_vars(semobj)) | ||
|
||
""" | ||
param_indices(semobj) | ||
|
||
Returns a dict of parameter names and their indices in `semobj`. | ||
|
||
# Examples | ||
```julia | ||
parind = param_indices(my_fitted_sem) | ||
parind[:param_name] | ||
``` | ||
|
||
See also [`params`](@ref). | ||
""" | ||
param_indices(semobj) = Dict(par => i for (i, par) in enumerate(params(semobj))) | ||
|
||
""" | ||
nsamples(semobj) | ||
|
||
Return the number of samples (observed data points). | ||
|
||
For ensemble models, return the sum over all submodels. | ||
""" | ||
function nsamples end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.