Skip to content

Commit d4fcf2a

Browse files
main into devel (#265)
* Documentation/fix docstrings (#260) Clean code, fix docstrings, fix docs * Hotfix/optim (#262) * version number * Update README.md
1 parent 8cbd504 commit d4fcf2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+173
-353
lines changed

Project.toml

Lines changed: 1 addition & 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.4.0"
4+
version = "0.4.2"
55

66
[deps]
77
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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

77
> [!NOTE]
8-
> Check out our [preprint](https://formal-methods-mpi.github.io/pkgmanuscript/manuscript.pdf) on the package!
8+
> Check out our [preprint](https://doi.org/10.31234/osf.io/zwe8g_v1) on the package!
99
1010
# What is this Package for?
1111

@@ -39,7 +39,7 @@ The package makes use of
3939
- SparseArrays.jl to speed up symbolic computations.
4040
- Optim.jl and NLopt.jl to provide a range of different Optimizers/Linesearches.
4141
- ProximalAlgorithms.jl for regularization.
42-
- FiniteDiff.jl and ForwardDiff.jl to provide gradients for user-defined loss functions.
42+
- FiniteDiff.jl and to provide gradient approximations for user-defined loss functions.
4343

4444
# At the moment, we are still working on:
4545
- optimizing performance for big models (with hundreds of parameters)

docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ makedocs(
5252
"files" => "internals/files.md",
5353
"types" => "internals/types.md",
5454
],
55-
"Complementary material" => ["Mathematical appendix" => "complementary/maths.md"],
5655
],
5756
format = Documenter.HTML(
5857
prettyurls = get(ENV, "CI", nothing) == "true",

docs/src/developer/implied.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ model per group and an additional model with `ImpliedEmpty` and `SemRidge` for t
6262
# Extended help
6363
6464
## Interfaces
65-
- `params(::RAMSymbolic) `-> Vector of parameter labels
66-
- `nparams(::RAMSymbolic)` -> Number of parameters
67-
68-
## Implementation
69-
Subtype of `SemImplied`.
65+
- `param_labels(::ImpliedEmpty) `-> Vector of parameter labels
66+
- `nparams(::ImpliedEmpty)` -> Number of parameters
7067
"""
7168
struct ImpliedEmpty{A, B, C} <: SemImplied
7269
hessianeval::A
@@ -78,7 +75,12 @@ end
7875
### Constructors
7976
############################################################################################
8077

81-
function ImpliedEmpty(;specification, meanstruct = NoMeanStruct(), hessianeval = ExactHessian(), kwargs...)
78+
function ImpliedEmpty(;
79+
specification,
80+
meanstruct = NoMeanStruct(),
81+
hessianeval = ExactHessian(),
82+
kwargs...,
83+
)
8284
return ImpliedEmpty(hessianeval, meanstruct, convert(RAMMatrices, specification))
8385
end
8486

docs/src/developer/loss.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ julia>?
204204

205205
help?> RAM
206206

207-
help?> SemObservedCommon
207+
help?> SemObservedData
208208
```
209209

210210
We see that the model implied covariance matrix can be assessed as `Σ(implied)` and the observed covariance matrix as `obs_cov(observed)`.

docs/src/developer/observed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ nsamples(observed::MyObserved) = ...
2828
nobserved_vars(observed::MyObserved) = ...
2929
```
3030

31-
As always, you can add additional methods for properties that implied types and loss function want to access, for example (from the `SemObservedCommon` implementation):
31+
As always, you can add additional methods for properties that implied types and loss function want to access, for example (from the `SemObservedData` implementation):
3232

3333
```julia
34-
obs_cov(observed::SemObservedCommon) = observed.obs_cov
34+
obs_cov(observed::SemObservedData) = observed.obs_cov
3535
```

docs/src/developer/optimizer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SemOptimizer{:Name}(args...; kwargs...) = SemOptimizerName(args...; kwargs...)
1616

1717
SemOptimizerName(;
1818
algorithm = LBFGS(),
19-
options = Optim.Options(; f_tol = 1e-10, x_tol = 1.5e-8),
19+
options = Optim.Options(; f_reltol = 1e-10, x_abstol = 1.5e-8),
2020
kwargs...,
2121
) = SemOptimizerName(algorithm, options)
2222

@@ -37,13 +37,13 @@ options(optimizer::SemOptimizerName) = optimizer.options
3737
Note that your optimizer is a subtype of `SemOptimizer{:Name}`, where you can choose a `:Name` that can later be used as a keyword argument to `fit(engine = :Name)`.
3838
Similarly, `SemOptimizer{:Name}(args...; kwargs...) = SemOptimizerName(args...; kwargs...)` should be defined as well as a constructor that uses only keyword arguments:
3939

40-
´´´julia
40+
```julia
4141
SemOptimizerName(;
4242
algorithm = LBFGS(),
43-
options = Optim.Options(; f_tol = 1e-10, x_tol = 1.5e-8),
43+
options = Optim.Options(; f_reltol = 1e-10, x_abstol = 1.5e-8),
4444
kwargs...,
4545
) = SemOptimizerName(algorithm, options)
46-
´´´
46+
```
4747
A method for `update_observed` and additional methods might be usefull, but are not necessary.
4848

4949
Now comes the substantive part: We need to provide a method for `fit`:

docs/src/internals/files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Source code is in the `"src"` folder:
1010
- `"StructuralEquationModels.jl"` defines the module and the exported objects
1111
- `"types.jl"` defines all abstract types and the basic type hierarchy
1212
- `"objective_gradient_hessian.jl"` contains methods for computing objective, gradient and hessian values for different model types as well as generic fallback methods
13-
- The four folders `"observed"`, `"implied"`, `"loss"` and `"diff"` contain implementations of specific subtypes (for example, the `"loss"` folder contains a file `"ML.jl"` that implements the `SemML` loss function).
13+
- The folders `"observed"`, `"implied"`, and `"loss"` contain implementations of specific subtypes (for example, the `"loss"` folder contains a file `"ML.jl"` that implements the `SemML` loss function).
1414
- `"optimizer"` contains connections to different optimization backends (aka methods for `fit`)
1515
- `"optim.jl"`: connection to the `Optim.jl` package
1616
- `"frontend"` contains user-facing functions

docs/src/internals/internals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Internals and Design
22

3-
On the following pages, we document the internals and design of the package. Those informations are no prerequisite for extending the package (as decribed in the developer documentation)!, but they may be useful and hopefully interesting.
3+
On the following pages, we document some technical information about the package. Those informations are no prerequisite for extending the package (as decribed in the developer documentation)!, but they may be useful.

docs/src/performance/simulation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Simulation studies
22

3-
!!! note "Simulation study interface"
4-
We are currently working on an interface for simulation studies.
5-
Until we are finished with this, this page is just a collection of tips.
6-
73
## Replace observed data
84
In simulation studies, a common task is fitting the same model to many different datasets.
95
It would be a waste of resources to reconstruct the complete model for each dataset.

0 commit comments

Comments
 (0)