-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cleanup Variables API #207
Open
alyst
wants to merge
26
commits into
StructuralEquationModels:devel
Choose a base branch
from
alyst:vars_api
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0645a4a
common.jl: common vars API methods
alyst 8b4abcf
SemSpecification: vars API
alyst a90defc
RAMMatrices: vars API
74c4550
ParamTable: vars API
alyst 800198c
SemImply: vars and params API
alyst c7a58ec
RAM imply: use vars API
534330d
RAMSymbolic: use vars API
2be665e
start_simple(): use vars API
8cf1f24
starts_fabin3: use vars API
7c51f8f
remove get_colnames()
5ed430b
remove get_n_nodes()
277f146
get_data() -> samples()
alyst a197fa3
SemObsData: remove rowwise
alyst 0a15204
AbstractSemSingle: vars API
alyst 6503a34
rename n_obs() -> nsamples()
alyst 77a0cba
rename n_man() -> nobserved_vars()
alyst ffc43a0
move Sem methods out of types.jl
alyst ab47745
rows(::SemObservedMissing) -> pattern_rows()
alyst c54fa33
fix formatting
alyst ee5b0be
samples(SemObsCov) throws an exception
alyst 91a149d
SemObserved tests: refactor and add var API tests
alyst 1f1f976
ParTable(graph): group is only valid for ensemble
alyst 1f12087
ParTable(graph): fix NaN modif detection
alyst 6f3afa8
refactor SemSpec tests
alyst 2982774
add Sem unit tests
alyst cf50d8c
test check_acyclic()
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 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 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 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 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 `semboj`. | ||
|
||
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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function (and the next ones) do not seem to be exported - I think we should do that. |
||
|
||
""" | ||
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 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 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 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 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 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 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.
This file was deleted.
Oops, something went wrong.
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.