diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 82570215d..9dd5ab6b7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: fail-fast: true matrix: version: - - '1.7.3' + - '1' os: - ubuntu-latest arch: diff --git a/.github/workflows/CI_ecosystem.yml b/.github/workflows/CI_ecosystem.yml index a3fa15887..98a79eb0b 100644 --- a/.github/workflows/CI_ecosystem.yml +++ b/.github/workflows/CI_ecosystem.yml @@ -18,7 +18,8 @@ jobs: fail-fast: false matrix: version: - - '1.7.3' + - '1' + - '1.9' os: - ubuntu-latest - macos-latest @@ -42,4 +43,4 @@ jobs: - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v2 with: - file: lcov.info \ No newline at end of file + file: lcov.info diff --git a/.github/workflows/CI_extended.yml b/.github/workflows/CI_extended.yml index f6857a517..4cc24d90d 100644 --- a/.github/workflows/CI_extended.yml +++ b/.github/workflows/CI_extended.yml @@ -18,7 +18,8 @@ jobs: fail-fast: false matrix: version: - - '1.7.3' + - '1' + - '1.9' os: - ubuntu-latest - macos-latest @@ -42,4 +43,4 @@ jobs: - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v2 with: - file: lcov.info \ No newline at end of file + file: lcov.info diff --git a/.github/workflows/TagBot b/.github/workflows/TagBot.yml similarity index 100% rename from .github/workflows/TagBot rename to .github/workflows/TagBot.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index beac68371..e7dacab73 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest with: - version: '1.7.2' + version: '1' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy diff --git a/.github/workflows/preview-documentation.yml b/.github/workflows/preview-documentation.yml index 9bc3297fd..29373527b 100644 --- a/.github/workflows/preview-documentation.yml +++ b/.github/workflows/preview-documentation.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest with: - version: '1.6' + version: '1' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy @@ -36,4 +36,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: 'Docs can be previewed here: ${{ env.GHP_URL }}previews/PR${{ env.PR_NUMBER }}' - }) \ No newline at end of file + }) diff --git a/Project.toml b/Project.toml index e2062f5a7..c8176911b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StructuralEquationModels" uuid = "383ca8c5-e4ff-4104-b0a9-f7b279deed53" authors = ["Maximilian Ernst", "Aaron Peikert"] -version = "0.1.0" +version = "0.2.0" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @@ -24,7 +24,7 @@ StenoGraphs = "78862bba-adae-4a83-bb4d-33c106177f81" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" [compat] -julia = "1.7" +julia = "1.9" StenoGraphs = "0.2" DataFrames = "1" Distributions = "0.25" diff --git a/src/StructuralEquationModels.jl b/src/StructuralEquationModels.jl index 17aa46d04..131ec206f 100644 --- a/src/StructuralEquationModels.jl +++ b/src/StructuralEquationModels.jl @@ -90,6 +90,7 @@ export AbstractSem, SemConstant, SemWLS, loss, SemOptimizer, SemOptimizerEmpty, SemOptimizerOptim, SemOptimizerNLopt, NLoptConstraint, + optimizer, n_iterations, convergence, SemObserved, SemObservedData, SemObservedCovariance, SemObservedMissing, observed, sem_fit, diff --git a/src/frontend/fit/standard_errors/hessian.jl b/src/frontend/fit/standard_errors/hessian.jl index 1300d7cb4..2afb08822 100644 --- a/src/frontend/fit/standard_errors/hessian.jl +++ b/src/frontend/fit/standard_errors/hessian.jl @@ -26,7 +26,7 @@ function se_hessian(sem_fit::SemFit; hessian = :finitediff) elseif hessian == :expected throw(ArgumentError("standard errors based on the expected hessian are not implemented yet")) else - throw(ArgumentError("I dont know how to compute `$how` standard-errors")) + throw(ArgumentError("I dont know how to compute `$hessian` standard-errors")) end invH = c*inv(H) @@ -44,9 +44,14 @@ H_scaling(model::AbstractSemSingle) = model.optimizer, model.loss.functions...) -H_scaling(model, obs, imp, optimizer, lossfun::Union{SemML, SemWLS}) = +H_scaling(model, obs, imp, optimizer, lossfun::SemML) = 2/(n_obs(model)-1) +function H_scaling(model, obs, imp, optimizer, lossfun::SemWLS) + @warn "Standard errors for WLS are only correct if a GLS weight matrix (the default) is used." + return 2/(n_obs(model)-1) +end + H_scaling(model, obs, imp, optimizer, lossfun::SemFIML) = 2/n_obs(model) diff --git a/src/imply/empty.jl b/src/imply/empty.jl index 38ff2690c..65d0e3259 100644 --- a/src/imply/empty.jl +++ b/src/imply/empty.jl @@ -3,6 +3,7 @@ ############################################################################################ """ Empty placeholder for models that don't need an imply part. +(For example, models that only regularize parameters.) # Constructor diff --git a/test/examples/political_democracy/constraints.jl b/test/examples/political_democracy/constraints.jl index 5044f7540..a9bc7aa1a 100644 --- a/test/examples/political_democracy/constraints.jl +++ b/test/examples/political_democracy/constraints.jl @@ -61,6 +61,6 @@ end solution_constrained = sem_fit(model_ml_constrained) @test solution_constrained.solution[31]*solution_constrained.solution[30] >= 0.6 @test all(abs.(solution_constrained.solution) .< 10) - @test_skip solution_constrained.optimization_result.result[3] == :FTOL_REACHED + @test solution_constrained.optimization_result.result[3] == :FTOL_REACHED skip=true @test abs(solution_constrained.minimum - 21.21) < 0.01 end \ No newline at end of file