Skip to content

Commit

Permalink
monor opt, clean, docs, test
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Aug 21, 2024
1 parent b76211b commit 8e7229b
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 345 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Implemented covariance structures:

Actually Metida can fit datasets with wore than 160k observation and 40k subjects levels on PC with 64 GB RAM. This is not "hard-coded" limitation, but depends on your model and data structure. Fitting of big datasets can take a lot of time. Optimal dataset size is less than 100k observations with maximum length of block less than 400.

!!! note
!!! warning

Julia v1.8 or higher required.

Expand Down
1 change: 1 addition & 0 deletions src/Metida.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Random: default_rng, AbstractRNG, rand!

export @formula, @covstr, @lmmformula,
SI, ScaledIdentity,
SWC, ScaledWeightedCov,
DIAG, Diag,
AR, Autoregressive,
ARH, HeterogeneousAutoregressive,
Expand Down
3 changes: 0 additions & 3 deletions src/fvalue.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# fvalue.jl

#=
Metida.fvalue(lmm, [0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 1 0])
=#
"""
fvalue(lmm::LMM, l::Matrix)
Expand Down
7 changes: 6 additions & 1 deletion src/reml.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ function reml_sweep_β(lmm, data, θ::Vector{T}; maxthreads::Int = 4) where T #
end
θ₁ = sum(accθ₁)
θ₂ = sum(accθ₂)
βm = sum(accβm)
if length(accβm) > 1
for i = 2:length(accβm)
accβm[1] += accβm[i]
end
end
βm = accβm[1]
noerror = all(erroracc)
noerror = noerror * checkmatrix!(θ₂)
θs₂ = Symmetric(θ₂)
Expand Down
5 changes: 1 addition & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ end
function fixedeffn(lmm::LMM)
fixedeffn(lmm.f)
end
#=
function nterms(mf::ModelFrame)
mf.schema.schema.count
=#

function nterms(rhs::Union{Tuple{Vararg{AbstractTerm}}, Nothing, AbstractTerm})
if isa(rhs, Term)
p = 1
Expand Down
Loading

0 comments on commit 8e7229b

Please sign in to comment.