From 78b3b842c918816028ce6eb8ac6b4fac15a237a9 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 04:44:51 +0300 Subject: [PATCH 01/11] export UN --- src/Metida.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Metida.jl b/src/Metida.jl index 567993d2..f9c9e762 100644 --- a/src/Metida.jl +++ b/src/Metida.jl @@ -33,6 +33,7 @@ TOEPHP, HeterogeneousToeplitzParameterized, SPEXP, SpatialExponential, SPPOW, SpatialPower, SPGAU, SpatialGaussian, +UN, Unstructured, CovarianceType, fit, fit!, LMM, VarEffect, theta, logreml, m2logreml, thetalength, dof_satter, dof_contain, rankx, caic, lcontrast, typeiii, estimate, contrast, gmatrix, rmatrix, vmatrix!, responsename, nblocks, raneff, From 5a45ca12c29df7c4c6ae4d406f153f4aa94cc18d Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 04:46:03 +0300 Subject: [PATCH 02/11] update --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f668a1e0..923be0c8 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "a1dec852-9fe5-11e9-361f-8d9fde67cfa2" keywords = ["lenearmodel", "mixedmodel"] desc = "Mixed-effects models with flexible covariance structure." authors = ["Vladimir Arnautov "] -version = "0.14.7" +version = "0.14.8" [deps] DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" From ccddbb59d9d30126216621fdc9b5abefc37303a9 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 05:01:34 +0300 Subject: [PATCH 03/11] upd test --- test/test.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.jl b/test/test.jl index 6c7f424e..303ad020 100644 --- a/test/test.jl +++ b/test/test.jl @@ -461,7 +461,7 @@ end random = Metida.VarEffect(Metida.@covstr(r1&r2|subject), Metida.DIAG), ) Metida.fit!(lmm) - @test Metida.theta(lmm) ≈ [3.0325005960015985, 3.343826588448401, 1.8477830405766895, 1.8477830405766895, 1.8477830405766895, 4.462942536844632, 1.0082345219318216] atol=1E-8 + @test Metida.theta(lmm) ≈ [3.0325005960015985, 3.343826588448401, 1.8477830405766895, 1.8477830405766895, 1.8477830405766895, 4.462942536844632, 1.0082345219318216] atol=1E-6 # atol=1E-8 ! @test Metida.m2logreml(lmm) ≈ 719.9413776641368 atol=1E-8 end @testset " Model: INT, +, TOEPHP(3)/SI " begin From 3d1a3819d1fe7ba83ecd26885de0ec65b58c3251 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 05:11:07 +0300 Subject: [PATCH 04/11] docs upd --- docs/src/api.md | 31 +++++++++++++++++++++++++++++++ docs/src/instanduse.md | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/src/api.md b/docs/src/api.md index 313fe271..fbd43712 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -111,6 +111,11 @@ Metida.Unstructured Metida.caic ``` +### Metida.coefn +```@docs +Metida.coefn +``` + ### Metida.dof_satter ```@docs Metida.dof_satter @@ -161,6 +166,11 @@ Metida.rand! Metida.raneff ``` +### Metida.raneffn +```@docs +Metida.raneffn +``` + ### Metida.rankx ```@docs Metida.rankx @@ -248,6 +258,11 @@ Metida.fit Metida.fit! ``` +### islinear +```@docs +Metida.islinear +``` + ### isfitted ```@docs Metida.isfitted @@ -315,6 +330,12 @@ Metida.dof_contain Metida.typeiii ``` +### Metida.MILMM +```@docs +Metida.MILMM +``` + + ## Not API functions @@ -342,3 +363,13 @@ Metida.mulθ₃ ```@docs Metida.mulαtβinc! ``` + +### Metida.tname +```@docs +Metida.tname +``` + +### Metida.raneflenv +```@docs +Metida.raneflenv +``` \ No newline at end of file diff --git a/docs/src/instanduse.md b/docs/src/instanduse.md index 459e987a..db11b892 100644 --- a/docs/src/instanduse.md +++ b/docs/src/instanduse.md @@ -60,7 +60,7 @@ nothing # hide Make model with `@formula` macro from `StatsModels`. Define `random` and `repreated` effects with [`Metida.VarEffect`](@ref) using [`Metida.@covstr`](@ref) macros. Left side of `@covstr` is model of effect and -right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diagonal`](@ref) in example bellow is a model of variance-covariance structure. See also [`Metida.@lmmformula`](@ref) macro. +right side is a effect itself. [`Metida.HeterogeneousCompoundSymmetry`](@ref) and [`Metida.Diag`](@ref) (Diagonal) in example bellow is a model of variance-covariance structure. See also [`Metida.@lmmformula`](@ref) macro. !!! note In some cases levels of repeated effect should not be equal inside each level of subject or model will not have any sense. For example, it is assumed that usually CSH or UN (Unstructured) using with levels of repeated effect is different inside each level of subject. From 6d8b27e32878749df14cfbe92f86ba71b84b8d15 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 05:01:34 +0300 Subject: [PATCH 05/11] upd test From ee65a32792ca9e5d75b68e75dc971eb5536e662f Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 05:11:07 +0300 Subject: [PATCH 06/11] docs upd From d069df0878c43c0d082d5881d9dd03d38def34da Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 15:54:09 +0300 Subject: [PATCH 07/11] update --- docs/make.jl | 1 + docs/src/api.md | 92 ++++++++++++++++++++++++++++++++++++++++++------ src/statsbase.jl | 3 +- 3 files changed, 84 insertions(+), 12 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index f12073ce..1ca14655 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -24,6 +24,7 @@ makedocs( "API" => "api.md", "Citation & Reference" => "ref.md", ], + checkdocs = :exports ) #= makedocs(format = DocumenterLaTeX.LaTeX(), diff --git a/docs/src/api.md b/docs/src/api.md index fbd43712..04a525ed 100644 --- a/docs/src/api.md +++ b/docs/src/api.md @@ -3,26 +3,31 @@ ## Basic ### @covstr + ```@docs Metida.@covstr ``` ### @lmmformula + ```@docs Metida.@lmmformula ``` ### Metida.CovarianceType + ```@docs Metida.CovarianceType ``` ### LMM + ```@docs Metida.LMM ``` ### VarEffect + ```@docs Metida.VarEffect ``` @@ -30,76 +35,91 @@ Metida.VarEffect ## Covariance structures ### Metida.Autoregressive + ```@docs Metida.Autoregressive ``` ### Metida.AutoregressiveMovingAverage + ```@docs Metida.AutoregressiveMovingAverage ``` ### Metida.CompoundSymmetry + ```@docs Metida.CompoundSymmetry ``` ### Metida.Diag + ```@docs Metida.Diag ``` ### Metida.HeterogeneousAutoregressive + ```@docs Metida.HeterogeneousAutoregressive ``` ### Metida.HeterogeneousCompoundSymmetry + ```@docs Metida.HeterogeneousCompoundSymmetry ``` ### Metida.HeterogeneousToeplitz + ```@docs Metida.HeterogeneousToeplitz ``` ### Metida.HeterogeneousToeplitzParameterized + ```@docs Metida.HeterogeneousToeplitzParameterized ``` ### Metida.ScaledIdentity + ```@docs Metida.ScaledIdentity ``` ### Metida.SpatialExponential + ```@docs Metida.SpatialExponential ``` ### Metida.SpatialGaussian + ```@docs Metida.SpatialGaussian ``` ### Metida.SpatialPower + ```@docs Metida.SpatialPower ``` ### Metida.Toeplitz + ```@docs Metida.Toeplitz ``` ### Metida.ToeplitzParameterized + ```@docs Metida.ToeplitzParameterized ``` ### Metida.Unstructured + ```@docs Metida.Unstructured ``` @@ -107,91 +127,109 @@ Metida.Unstructured ### Methods ### Metida.caic + ```@docs Metida.caic ``` ### Metida.coefn + ```@docs Metida.coefn ``` ### Metida.dof_satter + ```@docs Metida.dof_satter ``` ### Metida.estimate + ```@docs Metida.estimate ``` ### Metida.getlog + ```@docs Metida.getlog ``` ### Metida.gmatrix + ```@docs Metida.gmatrix ``` ### Metida.hessian + ```@docs Metida.hessian ``` ### Metida.lcontrast + ```@docs Metida.lcontrast ``` ### Metida.nblocks + ```@docs Metida.nblocks ``` ### Metida.rand + ```@docs Metida.rand ``` -### Metida.rand! +### Metida.rand + ```@docs Metida.rand! ``` ### Metida.raneff + ```@docs Metida.raneff ``` ### Metida.raneffn + ```@docs Metida.raneffn ``` ### Metida.rankx + ```@docs Metida.rankx ``` ### Metida.rmatrix + ```@docs Metida.rmatrix ``` ### Metida.theta + ```@docs Metida.theta ``` ### Metida.thetalength + ```@docs Metida.thetalength ``` -### Metida.vmatrix! +### Metida.vmatrix + ```@docs Metida.vmatrix! ``` @@ -199,177 +237,209 @@ Metida.vmatrix! ## StatsAPI ### Metida.aic + ```@docs Metida.aic ``` ### Metida.aicc + ```@docs Metida.aicc ``` ### Metida.bic + ```@docs Metida.bic ``` ### Metida.coef + ```@docs Metida.coef ``` ### Metida.coefnames + ```@docs Metida.coefnames ``` ### Metida.coeftable + ```@docs Metida.coeftable ``` ### Metida.confint + ```@docs Metida.confint ``` ### Metida.crossmodelmatrix + ```@docs Metida.crossmodelmatrix ``` ### Metida.dof + ```@docs Metida.dof ``` ### Metida.dof_residual + ```@docs Metida.dof_residual ``` ### Metida.fit + ```@docs Metida.fit ``` -### Metida.fit! +### Metida.fit + ```@docs Metida.fit! ``` -### islinear +### islinear + ```@docs Metida.islinear ``` ### isfitted + ```@docs Metida.isfitted ``` ### Metida.loglikelihood + ```@docs Metida.loglikelihood ``` ### Metida.modelmatrix + ```@docs Metida.modelmatrix ``` ### Metida.nobs + ```@docs Metida.nobs ``` ### Metida.response + ```@docs Metida.response ``` ### Metida.responsename + ```@docs Metida.responsename ``` ### Metida.stderror + ```@docs Metida.stderror ``` ### Metida.vcov + ```@docs Metida.vcov ``` -## Experimental +## Experimental ### Metida.SpatialExponentialD + ```@docs Metida.SpatialExponentialD ``` ### Metida.SpatialGaussianD + ```@docs Metida.SpatialGaussianD ``` ### Metida.SpatialPowerD + ```@docs Metida.SpatialPowerD ``` ### Metida.dof_contain + ```@docs Metida.dof_contain ``` ### Metida.typeiii + ```@docs Metida.typeiii ``` ### Metida.MILMM + ```@docs Metida.MILMM ``` - ## Not API functions - ### Metida.contrast + ```@docs Metida.contrast ``` ### Metida.fvalue + ```@docs Metida.fvalue ``` -### Metida.mulαβαtinc! +### Metida.mulαβαtinc + ```@docs Metida.mulαβαtinc! ``` ### Metida.mulθ₃ + ```@docs Metida.mulθ₃ ``` -### Metida.mulαtβinc! +### Metida.mulαtβinc + ```@docs Metida.mulαtβinc! ``` -### Metida.tname +### Metida.tname + ```@docs Metida.tname ``` ### Metida.raneflenv + ```@docs Metida.raneflenv -``` \ No newline at end of file +``` diff --git a/src/statsbase.jl b/src/statsbase.jl index 416d5dd2..76936d2d 100644 --- a/src/statsbase.jl +++ b/src/statsbase.jl @@ -1,5 +1,6 @@ """ - islinear(model::LMM) = true + StatsBase.islinear(model::LMM) + """ StatsBase.islinear(model::LMM) = true From 64ab23d29a1f4071799eb8259b863bc9bec3e3bd Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 15:54:09 +0300 Subject: [PATCH 08/11] update From d1833885ab658b867fffef1d907d46204a3d4fb1 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 18 Oct 2023 22:23:59 +0300 Subject: [PATCH 09/11] update --- src/Metida.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Metida.jl b/src/Metida.jl index f9c9e762..cbbb91f3 100644 --- a/src/Metida.jl +++ b/src/Metida.jl @@ -14,7 +14,7 @@ import MetidaBase.PrettyTables: TextFormat, pretty_table, tf_borderless, ft_prin import Distributions: Normal, TDist, FDist, Chisq, MvNormal, FullNormal, ccdf, cdf, quantile import LinearAlgebra: checksquare, BlasFloat import StatsModels: @formula, termvars, ModelFrame, FunctionTerm, AbstractTerm, CategoricalTerm, AbstractContrasts, ConstantTerm, InterceptTerm, Term, InteractionTerm, FormulaTerm, ModelMatrix, schema, apply_schema, MatrixTerm, modelcols -import StatsBase: fit, fit!, coef, coefnames, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, vcov, mean, var, stderror, modelmatrix, response, responsename, CoefTable, coeftable, crossmodelmatrix +import StatsBase: fit, fit!, coef, coefnames, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, islinear, vcov, mean, var, stderror, modelmatrix, response, responsename, CoefTable, coeftable, crossmodelmatrix import Base: show, rand, ht_keyindex, getproperty import Random: default_rng, AbstractRNG, rand! @@ -41,7 +41,7 @@ AbstractCovarianceType, AbstractCovmatMethod, MetidaModel, getlog, rand, rand!, bootstrap -export coef, coefnames, coeftable, crossmodelmatrix, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, vcov, stderror, modelmatrix, response +export coef, coefnames, coeftable, crossmodelmatrix, confint, nobs, dof_residual, dof, loglikelihood, aic, bic, aicc, isfitted, islinear, vcov, stderror, modelmatrix, response num_cores() = Int(MetidaBase.num_cores()) From fc0285bb7f81ab4bb6678c4caa0a102712cf1709 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Wed, 7 Jun 2023 23:04:04 +0300 Subject: [PATCH 10/11] fix docs --- docs/Project.toml | 22 ++++++++++++---------- docs/src/examples.md | 8 +------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index a31cd3ca..bc0815a6 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,22 +1,24 @@ [deps] -Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +MixedModels = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" -CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -Documenter = "≥0.26" -Plots = "≥1" -StatsPlots = "≥0.14" +CategoricalArrays = "≥0.9, 0.10" CSV = "≥0.8" DataFrames = "≥1" +Distributions = "≥0.25" +Documenter = "≥0.26" +MixedModels = "≥4.14" +Plots = "≥1" PrettyTables = "1, 2" StatsBase = "≥0.33" -Distributions = "≥0.25" -CategoricalArrays = "≥0.9, 0.10" +StatsPlots = "≥0.14" diff --git a/docs/src/examples.md b/docs/src/examples.md index 27a0fcd9..a10e836b 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -1,13 +1,7 @@ ### Example 1 - Continuous and categorical predictors ```@example lmmexample -using Metida, CSV, DataFrames, CategoricalArrays, Plots; - -import Pkg -Pkg.activate("MixedModels") -Pkg.add(name="MixedModels", version="3.1.5") -using MixedModels - +using Metida, CSV, DataFrames, CategoricalArrays, MixedModels; rds = CSV.File(joinpath(dirname(pathof(Metida)), "..", "test", "csv", "1fptime.csv"); types = [String, String, Float64, Float64]) |> DataFrame From 2feaeedb8e145d8eb3feaabb37ef61248c37dcd5 Mon Sep 17 00:00:00 2001 From: PharmCat Date: Thu, 19 Oct 2023 01:10:32 +0300 Subject: [PATCH 11/11] update --- .github/workflows/Documenter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 5762ae34..5ca7853f 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -21,12 +21,12 @@ on: jobs: build: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 with: - version: "1" + version: "1.8" - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-docdeploy@v1 - name: Install dependencies