Skip to content

Commit 8cbd504

Browse files
merge main into devel
2 parents cbb666b + 7676036 commit 8cbd504

File tree

10 files changed

+65
-13
lines changed

10 files changed

+65
-13
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ jobs:
3333
- uses: julia-actions/julia-buildpkg@v1
3434
- uses: julia-actions/julia-runtest@v1
3535
- uses: julia-actions/julia-processcoverage@v1
36-
- uses: codecov/codecov-action@v4
36+
- uses: codecov/codecov-action@v5
3737
with:
3838
file: lcov.info

.github/workflows/CI_ecosystem.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ jobs:
3636
- uses: julia-actions/julia-buildpkg@v1
3737
- uses: julia-actions/julia-runtest@v1
3838
- uses: julia-actions/julia-processcoverage@v1
39-
- uses: codecov/codecov-action@v4
39+
- uses: codecov/codecov-action@v5
4040
with:
4141
file: lcov.info

.github/workflows/CI_extended.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
- uses: julia-actions/julia-buildpkg@v1
3636
- uses: julia-actions/julia-runtest@v1
3737
- uses: julia-actions/julia-processcoverage@v1
38-
- uses: codecov/codecov-action@v4
38+
- uses: codecov/codecov-action@v5
3939
with:
4040
file: lcov.info

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StructuralEquationModels"
22
uuid = "383ca8c5-e4ff-4104-b0a9-f7b279deed53"
33
authors = ["Maximilian Ernst", "Aaron Peikert"]
4-
version = "0.3.0"
4+
version = "0.4.0"
55

66
[deps]
77
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
@@ -39,6 +39,7 @@ ProximalAlgorithms = "0.7"
3939
StatsBase = "0.33, 0.34"
4040
Symbolics = "4, 5, 6"
4141
SymbolicUtils = "1.4 - 1.5, 1.7, 2, 3"
42+
StatsAPI = "1"
4243

4344
[extras]
4445
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
|:-------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------:|
55
| [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://structuralequationmodels.github.io/StructuralEquationModels.jl/) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://structuralequationmodels.github.io/StructuralEquationModels.jl/dev/) | [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![Github Action CI](https://github.com/StructuralEquationModels/StructuralEquationModels.jl/workflows/CI_extended/badge.svg)](https://github.com/StructuralEquationModels/StructuralEquationModels.jl/actions/) [![codecov](https://codecov.io/gh/StructuralEquationModels/StructuralEquationModels.jl/branch/main/graph/badge.svg?token=P2kjzpvM4V)](https://codecov.io/gh/StructuralEquationModels/StructuralEquationModels.jl) | [![DOI](https://zenodo.org/badge/228649704.svg)](https://zenodo.org/badge/latestdoi/228649704) |
66

7+
> [!NOTE]
8+
> Check out our [preprint](https://formal-methods-mpi.github.io/pkgmanuscript/manuscript.pdf) on the package!
9+
710
# What is this Package for?
811

912
This is a package for Structural Equation Modeling.

docs/src/tutorials/collection/multigroup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ model_ml_multigroup = SemEnsemble(
8181
We now fit the model and inspect the parameter estimates:
8282

8383
```@example mg; ansicolor = true
84-
fit = fit(model_ml_multigroup)
85-
update_estimate!(partable, fit)
84+
sem_fit = fit(model_ml_multigroup)
85+
update_estimate!(partable, sem_fit)
8686
details(partable)
8787
```
8888

docs/src/tutorials/inspection/inspection.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ Additional functions that can be used to extract information from a `SemFit` obj
117117

118118
```@docs
119119
SemFit
120+
params
121+
param_labels
122+
nparams
123+
nsamples
124+
nobserved_vars
120125
```
121126

122127
## Fit measures
@@ -128,10 +133,6 @@ BIC
128133
χ²
129134
dof
130135
minus2ll
131-
nobserved_vars
132-
nsamples
133-
param_labels
134-
nparams
135136
p_value
136137
RMSEA
137138
```

docs/src/tutorials/regularization/regularization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ fit_lasso = fit(optimizer_lasso, model_lasso)
126126
and compare the solution to unregularizted estimates:
127127

128128
```@example reg
129-
fit = fit(model)
129+
sem_fit = fit(model)
130130
131-
update_estimate!(partable, fit)
131+
update_estimate!(partable, sem_fit)
132132
133133
update_partable!(partable, :estimate_lasso, param_labels(fit_lasso), solution(fit_lasso))
134134
@@ -138,7 +138,7 @@ details(partable)
138138
Instead of explicitely defining a `SemOptimizerProximal` object, you can also pass `engine = :Proximal` and additional keyword arguments to `fit`:
139139

140140
```@example reg
141-
fit = fit(model; engine = :Proximal, operator_g = NormL1(λ))
141+
sem_fit = fit(model; engine = :Proximal, operator_g = NormL1(λ))
142142
```
143143

144144
## Second example - mixed l1 and l0 regularization

src/frontend/specification/documentation.jl

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,45 @@ model.
2929
"""
3030
function latent_vars end
3131

32+
latent_vars(spec::SemSpecification) =
33+
error("latent_vars(spec::$(typeof(spec))) is not implemented")
34+
35+
"""
36+
param_labels(semobj) -> Vector{Symbol}
37+
38+
Return the vector of parameter labels (in the same order as [`params`](@ref)).
39+
"""
40+
param_labels(spec::SemSpecification) = spec.param_labels
41+
42+
"""
43+
vars(semobj) -> Vector{Symbol}
44+
45+
Return the vector of SEM model variables (both observed and latent)
46+
in the order specified by the model.
47+
"""
48+
function vars end
49+
50+
vars(spec::SemSpecification) = error("vars(spec::$(typeof(spec))) is not implemented")
51+
52+
"""
53+
observed_vars(semobj) -> Vector{Symbol}
54+
55+
Return the vector of SEM model observed variable in the order specified by the
56+
model, which also should match the order of variables in [`SemObserved`](@ref).
57+
"""
58+
function observed_vars end
59+
60+
observed_vars(spec::SemSpecification) =
61+
error("observed_vars(spec::$(typeof(spec))) is not implemented")
62+
63+
"""
64+
latent_vars(semobj) -> Vector{Symbol}
65+
66+
Return the vector of SEM model latent variable in the order specified by the
67+
model.
68+
"""
69+
function latent_vars end
70+
3271
latent_vars(spec::SemSpecification) =
3372
error("latent_vars(spec::$(typeof(spec))) is not implemented")
3473

test/unit_tests/unit_tests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ selected_tests = isempty(ARGS) ? collect(keys(available_tests)) : ARGS
3333
end
3434
end
3535
end
36+
37+
@safetestset "SemSpecification" begin
38+
include("specification.jl")
39+
end
40+
41+
@safetestset "Sem model" begin
42+
include("model.jl")
43+
end

0 commit comments

Comments
 (0)