Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Jan 2, 2023
1 parent be05c3b commit ab9fcb0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "a1dec852-9fe5-11e9-361f-8d9fde67cfa2"
keywords = ["lenearmodel", "mixedmodel"]
desc = "Mixed-effects models with flexible covariance structure."
authors = ["Vladimir Arnautov <[email protected]>"]
version = "0.14.4"
version = "0.14.5"

[deps]
DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
Expand Down
24 changes: 12 additions & 12 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,24 @@ Metida.hessian
Metida.lcontrast
```

### Metida.nblocks
```@docs
Metida.nblocks
```

### Metida.rand
```@docs
Metida.rand
```

### Metida.rand!
```@docs
Metida.rand
Metida.rand!
```

### Metida.raneff
```@docs
Metida.raneff
```

### Metida.rankx
Expand Down Expand Up @@ -215,7 +225,7 @@ Metida.confint

### Metida.crossmodelmatrix
```@docs
StatsBase.crossmodelmatrix
Metida.crossmodelmatrix
```

### Metida.dof
Expand Down Expand Up @@ -253,21 +263,11 @@ Metida.loglikelihood
Metida.modelmatrix
```

### Metida.nblocks
```@docs
Metida.nblocks
```

### Metida.nobs
```@docs
Metida.nobs
```

### Metida.raneff
```@docs
Metida.raneff
```

### Metida.response
```@docs
Metida.response
Expand Down
2 changes: 1 addition & 1 deletion docs/src/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ logREML(\theta,\beta) = -\frac{N-p}{2} - \frac{1}{2}\sum_{i=1}^nlog|V_{\theta, i
-\frac{1}{2}log|\sum_{i=1}^nX_i'V_{\theta, i}^{-1}X_i|-\frac{1}{2}\sum_{i=1}^n(y_i - X_{i}\beta)'V_{\theta, i}^{-1}(y_i - X_{i}\beta)
```

Actually ```L(\theta) = -2logREML = L_1(\theta) + L_2(\theta) + \L_3(\theta) + c`` used for optimization, where:
Actually ```L(\theta) = -2logREML = L_1(\theta) + L_2(\theta) + L_3(\theta) + c`` used for optimization, where:

```math
L_1(\theta) = \frac{1}{2}\sum_{i=1}^nlog|V_{i}| \\
Expand Down
6 changes: 6 additions & 0 deletions docs/src/nlopt.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ random = VarEffect(@covstr(formulation|subject), CSH),
repeated = VarEffect(@covstr(formulation|subject), VC))
fit!(lmm; solver = :nlopt)
```


NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms.


Optimization with NLopt.jl using gradient-free algirithms is less stable, that why two-step optimization schema used. Results can be slightly different for differens OS and Julia versions. Always look into logs.
8 changes: 8 additions & 0 deletions src/linearalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# Fine
"""
mulαβαtinc!(θ::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix)
θ + A * B * A'
Change θ (only upper triangle). B is symmetric.
Expand Down Expand Up @@ -31,6 +33,8 @@ function mulαβαtinc!(θ::AbstractMatrix{T}, A::AbstractMatrix{T}, B::Abstract
end
=#
"""
mulαβαtinc!(θ::AbstractMatrix, A::AbstractMatrix, B::AbstractMatrix, alpha)
θ + A * B * A' * alpha
Change θ (only upper triangle). B is symmetric.
Expand All @@ -54,6 +58,8 @@ Change θ (only upper triangle). B is symmetric.
θ
end
"""
mulαβαtinc!(θ::AbstractVector{T}, A::AbstractMatrix, B::AbstractMatrix, a::AbstractVector, b::AbstractVector, alpha) where T
θ + A * B * (a - b) * alpha
Change θ (only upper triangle). B is symmetric.
Expand Down Expand Up @@ -114,6 +120,8 @@ use only upper triangle of V
end

"""
mulαtβinc!(θ::AbstractVector{T}, A::AbstractMatrix, b::AbstractVector) where T
θ + A' * b
Change θ.
Expand Down

0 comments on commit ab9fcb0

Please sign in to comment.