From 9f41f920548fb1f33c07b73676c85c040e2f0230 Mon Sep 17 00:00:00 2001 From: Maximilian Ernst Date: Thu, 22 Jan 2026 14:28:06 +0100 Subject: [PATCH 1/4] update concept figures --- docs/src/assets/concept.svg | 172 +----------------------------- docs/src/assets/concept_typed.svg | 172 +----------------------------- 2 files changed, 2 insertions(+), 342 deletions(-) diff --git a/docs/src/assets/concept.svg b/docs/src/assets/concept.svg index fa222a0d9..f82e47943 100644 --- a/docs/src/assets/concept.svg +++ b/docs/src/assets/concept.svg @@ -1,171 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/docs/src/assets/concept_typed.svg b/docs/src/assets/concept_typed.svg index 88a0d8566..e046819ae 100644 --- a/docs/src/assets/concept_typed.svg +++ b/docs/src/assets/concept_typed.svg @@ -1,171 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file From 8f2a10191f5529d3db0d8713a4616499ffae7794 Mon Sep 17 00:00:00 2001 From: Maximilian Ernst Date: Thu, 22 Jan 2026 14:32:14 +0100 Subject: [PATCH 2/4] add SemOptimizerProximal to table --- docs/src/tutorials/concept.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/src/tutorials/concept.md b/docs/src/tutorials/concept.md index 035144d62..128117a09 100644 --- a/docs/src/tutorials/concept.md +++ b/docs/src/tutorials/concept.md @@ -21,13 +21,13 @@ So everything that can be used as the 'observed' part has to be of type `SemObse Here is an overview on the available building blocks: -|[`SemObserved`](@ref) | [`SemImplied`](@ref) | [`SemLossFunction`](@ref) | [`SemOptimizer`](@ref) | -|---------------------------------|-----------------------|---------------------------|-------------------------------| -| [`SemObservedData`](@ref) | [`RAM`](@ref) | [`SemML`](@ref) | [`SemOptimizerOptim`](@ref) | -| [`SemObservedCovariance`](@ref) | [`RAMSymbolic`](@ref) | [`SemWLS`](@ref) | [`SemOptimizerNLopt`](@ref) | -| [`SemObservedMissing`](@ref) | [`ImpliedEmpty`](@ref)| [`SemFIML`](@ref) | | -| | | [`SemRidge`](@ref) | | -| | | [`SemConstant`](@ref) | | +|[`SemObserved`](@ref) | [`SemImplied`](@ref) | [`SemLossFunction`](@ref) | [`SemOptimizer`](@ref) | +|---------------------------------|-----------------------|---------------------------|--------------------------------| +| [`SemObservedData`](@ref) | [`RAM`](@ref) | [`SemML`](@ref) | [`SemOptimizerOptim`](@ref) | +| [`SemObservedCovariance`](@ref) | [`RAMSymbolic`](@ref) | [`SemWLS`](@ref) | [`SemOptimizerNLopt`](@ref) | +| [`SemObservedMissing`](@ref) | [`ImpliedEmpty`](@ref)| [`SemFIML`](@ref) | [`SemOptimizerProximal`](@ref) | +| | | [`SemRidge`](@ref) | | +| | | [`SemConstant`](@ref) | | The rest of this page explains the building blocks for each part. First, we explain every part and give an overview on the different options that are available. After that, the [API - model parts](@ref) section serves as a reference for detailed explanations about the different options. (How to stick them together to a final model is explained in the section on [Model Construction](@ref).) From fc2bc1664ecb1085197511876b72f250a2630693 Mon Sep 17 00:00:00 2001 From: Maximilian Ernst Date: Fri, 13 Feb 2026 11:10:44 +0100 Subject: [PATCH 3/4] add docstring for --- src/frontend/fit/SemFit.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontend/fit/SemFit.jl b/src/frontend/fit/SemFit.jl index 438da4da6..eeaf8be9f 100644 --- a/src/frontend/fit/SemFit.jl +++ b/src/frontend/fit/SemFit.jl @@ -52,6 +52,11 @@ nsamples(fit::SemFit) = nsamples(fit.model) # access fields minimum(sem_fit::SemFit) = sem_fit.minimum +""" + solution(sem_fit::SemFit) + +Returns the vector of parameter estimates from a fitted SEM. +""" solution(sem_fit::SemFit) = sem_fit.solution start_val(sem_fit::SemFit) = sem_fit.start_val model(sem_fit::SemFit) = sem_fit.model From 61acab6cf6659eeb9651dcc5ac89d677ff06a249 Mon Sep 17 00:00:00 2001 From: Maximilian Ernst Date: Fri, 13 Feb 2026 11:51:17 +0100 Subject: [PATCH 4/4] add docstring for --- src/objective_gradient_hessian.jl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/objective_gradient_hessian.jl b/src/objective_gradient_hessian.jl index 06f39329f..69915ffa9 100644 --- a/src/objective_gradient_hessian.jl +++ b/src/objective_gradient_hessian.jl @@ -23,6 +23,31 @@ is_hessian_required(::EvaluationTargets{<:Any, <:Any, H}) where {H} = H (targets::EvaluationTargets)(arg_tuple::Tuple) = targets(arg_tuple...) +""" + evaluate!(objective, gradient, hessian [, lossfun], model, params) + +Evaluates the objective, gradient, and/or Hessian at the given parameter vector. +If a loss function is passed, only this specific loss function is evaluated, otherwise, +the sum of all loss functions in the model is evaluated. + +If objective, gradient or hessian are `nothing`, they are not evaluated. +For example, since many numerical optimization algorithms don't require a Hessian, +the computation will be turned off by setting `hessian` to `nothing`. + +# Arguments +- `objective`: a Number if the objective should be evaluated, otherwise `nothing` +- `gradient`: a pre-allocated vector the gradient should be written to, otherwise `nothing` +- `hessian`: a pre-allocated matrix the Hessian should be written to, otherwise `nothing` +- `lossfun::SemLossFunction`: loss function to evaluate +- `model::AbstractSem`: model to evaluate +- `params`: vector of parameters + +# Implementing a new loss function +To implement a new loss function, a new method for `evaluate!` has to be defined. +This is explained in the online documentation on [Custom loss functions](@ref). +""" +function evaluate! end + # dispatch on SemImplied evaluate!(objective, gradient, hessian, loss::SemLossFunction, model::AbstractSem, params) = evaluate!(objective, gradient, hessian, loss, implied(model), model, params)