From 1fe165be02fc810197359cb2dff99e234464a7b7 Mon Sep 17 00:00:00 2001 From: Maximilian Ernst Date: Sun, 2 Feb 2025 12:09:04 +0100 Subject: [PATCH] close #158 --- docs/src/tutorials/collection/multigroup.md | 2 +- docs/src/tutorials/constraints/constraints.md | 4 ++-- docs/src/tutorials/first_model.md | 6 +++--- docs/src/tutorials/inspection/inspection.md | 12 ++++++------ .../src/tutorials/regularization/regularization.md | 4 ++-- src/StructuralEquationModels.jl | 2 +- src/frontend/fit/summary.jl | 14 +++++++------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/src/tutorials/collection/multigroup.md b/docs/src/tutorials/collection/multigroup.md index 5ee88e936..d0fc71796 100644 --- a/docs/src/tutorials/collection/multigroup.md +++ b/docs/src/tutorials/collection/multigroup.md @@ -83,7 +83,7 @@ We now fit the model and inspect the parameter estimates: ```@example mg; ansicolor = true solution = sem_fit(model_ml_multigroup) update_estimate!(partable, solution) -sem_summary(partable) +details(partable) ``` Other things you can query about your fitted model (fit measures, standard errors, etc.) are described in the section [Model inspection](@ref) and work the same way for multigroup models. \ No newline at end of file diff --git a/docs/src/tutorials/constraints/constraints.md b/docs/src/tutorials/constraints/constraints.md index a67ad7372..ffd83d4e0 100644 --- a/docs/src/tutorials/constraints/constraints.md +++ b/docs/src/tutorials/constraints/constraints.md @@ -52,7 +52,7 @@ model_fit = sem_fit(model) update_estimate!(partable, model_fit) -sem_summary(partable) +details(partable) ``` ### Define the constraints @@ -165,7 +165,7 @@ update_partable!( solution(model_fit_constrained), ) -sem_summary(partable) +details(partable) ``` As we can see, the constrained solution is very close to the original solution (compare the columns estimate and estimate_constr), with the difference that the constrained parameters fulfill their constraints. diff --git a/docs/src/tutorials/first_model.md b/docs/src/tutorials/first_model.md index 7568a5917..a285e29df 100644 --- a/docs/src/tutorials/first_model.md +++ b/docs/src/tutorials/first_model.md @@ -119,10 +119,10 @@ and compute fit measures as fit_measures(model_fit) ``` -We can also get a bit more information about the fitted model via the `sem_summary()` function: +We can also get a bit more information about the fitted model via the `details()` function: ```@example high_level; ansicolor = true -sem_summary(model_fit) +details(model_fit) ``` To investigate the parameter estimates, we can update our `partable` object to contain the new estimates: @@ -134,7 +134,7 @@ update_estimate!(partable, model_fit) and investigate the solution with ```@example high_level; ansicolor = true -sem_summary(partable) +details(partable) ``` Congratulations, you fitted and inspected your very first model! diff --git a/docs/src/tutorials/inspection/inspection.md b/docs/src/tutorials/inspection/inspection.md index 88caf5812..faab8f8ed 100644 --- a/docs/src/tutorials/inspection/inspection.md +++ b/docs/src/tutorials/inspection/inspection.md @@ -53,10 +53,10 @@ model_fit = sem_fit(model) you end up with an object of type [`SemFit`](@ref). -You can get some more information about it by using the `sem_summary` function: +You can get some more information about it by using the `details` function: ```@example colored; ansicolor = true -sem_summary(model_fit) +details(model_fit) ``` To compute fit measures, we use @@ -73,12 +73,12 @@ AIC(model_fit) A list of available [Fit measures](@ref) is at the end of this page. -To inspect the parameter estimates, we can update a `ParameterTable` object and call `sem_summary` on it: +To inspect the parameter estimates, we can update a `ParameterTable` object and call `details` on it: ```@example colored; ansicolor = true; output = false update_estimate!(partable, model_fit) -sem_summary(partable) +details(partable) ``` We can also update the `ParameterTable` object with other information via [`update_partable!`](@ref). For example, if we want to compare hessian-based and bootstrap-based standard errors, we may write @@ -90,7 +90,7 @@ se_he = se_hessian(model_fit) update_partable!(partable, :se_hessian, params(model_fit), se_he) update_partable!(partable, :se_bootstrap, params(model_fit), se_bs) -sem_summary(partable) +details(partable) ``` ## Export results @@ -106,7 +106,7 @@ parameters_df = DataFrame(partable) # API - model inspection ```@docs -sem_summary +details update_estimate! update_partable! ``` diff --git a/docs/src/tutorials/regularization/regularization.md b/docs/src/tutorials/regularization/regularization.md index 4aaff1d0a..02d3b3bac 100644 --- a/docs/src/tutorials/regularization/regularization.md +++ b/docs/src/tutorials/regularization/regularization.md @@ -148,7 +148,7 @@ update_estimate!(partable, fit) update_partable!(partable, :estimate_lasso, params(fit_lasso), solution(fit_lasso)) -sem_summary(partable) +details(partable) ``` ## Second example - mixed l1 and l0 regularization @@ -182,5 +182,5 @@ Let's again compare the different results: ```@example reg update_partable!(partable, :estimate_mixed, params(fit_mixed), solution(fit_mixed)) -sem_summary(partable) +details(partable) ``` \ No newline at end of file diff --git a/src/StructuralEquationModels.jl b/src/StructuralEquationModels.jl index a6677a4ed..b0ca407ff 100644 --- a/src/StructuralEquationModels.jl +++ b/src/StructuralEquationModels.jl @@ -131,7 +131,7 @@ export AbstractSem, SemFit, minimum, solution, - sem_summary, + details, objective!, gradient!, hessian!, diff --git a/src/frontend/fit/summary.jl b/src/frontend/fit/summary.jl index e6026e5f4..d9b137a58 100644 --- a/src/frontend/fit/summary.jl +++ b/src/frontend/fit/summary.jl @@ -1,4 +1,4 @@ -function sem_summary( +function details( sem_fit::SemFit; show_fitmeasures = false, color = :light_cyan, @@ -45,7 +45,7 @@ function sem_summary( print("\n") end -function sem_summary( +function details( partable::ParameterTable; color = :light_cyan, secondary_color = :light_yellow, @@ -250,7 +250,7 @@ function sem_summary( end -function sem_summary( +function details( partable::EnsembleParameterTable; color = :light_cyan, secondary_color = :light_yellow, @@ -291,7 +291,7 @@ function sem_summary( print("\n") printstyled(rpad(" Group: $k", 78), reverse = true) print("\n") - sem_summary( + details( partable.tables[k]; color = color, secondary_color = secondary_color, @@ -333,9 +333,9 @@ function Base.findall(fun::Function, partable::ParameterTable) end """ - (1) sem_summary(sem_fit::SemFit; show_fitmeasures = false) + (1) details(sem_fit::SemFit; show_fitmeasures = false) - (2) sem_summary(partable::AbstractParameterTable; ...) + (2) details(partable::AbstractParameterTable; ...) Print information about (1) a fitted SEM or (2) a parameter table to stdout. @@ -347,4 +347,4 @@ Print information about (1) a fitted SEM or (2) a parameter table to stdout. - `show_variables = true` - `show_columns = nothing`: columns names to include in the output e.g.`[:from, :to, :estimate]`) """ -function sem_summary end +function details end