Skip to content

Commit

Permalink
docs, MetidaBase 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
PharmCat committed Jul 28, 2021
1 parent fb4e3e5 commit e346fee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LineSearches = "7"
Optim = "1"
StatsBase = "0.29, 0.30, 0.31, 0.32, 0.33"
julia = "1"
MetidaBase = "0.2.2"
MetidaBase = "0.3"
#LoopVectorization = "0.12"

[extras]
Expand Down
24 changes: 22 additions & 2 deletions docs/src/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,31 @@ V_{i} = Z_{i}GZ_i'+R_{i}
#### REML

```math
logREML(\theta,\beta) = -\frac{N-p}{2} - \frac{1}{2}\sum_{i=1}^nlog|V_{i}|-
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_i^{-1}X_i|-\frac{1}{2}\sum_{i=1}^n(y_i - X_{i}\beta)'V_i^{-1}(y_i - X_{i}\beta)
-\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 ``\mathcal{L}(\theta) = -2logREML`` used for optimization, ``-2logREML = L_1(\theta) + L_2(\theta) + \L_3(\theta) + c``, where:

```math
L_1(\theta) = \frac{1}{2}\sum_{i=1}^nlog|V_{i}| \\
L_2(\theta) = \frac{1}{2}log|\sum_{i=1}^nX_i'V_i^{-1}X_i| \\
L_3(\theta) = \frac{1}{2}\sum_{i=1}^n(y_i - X_{i}\beta)'V_i^{-1}(y_i - X_{i}\beta)
```

```math
\nabla\mathcal{L}(\theta) = \nabla L_1(\theta) + \nabla L_2(\theta) + \nabla L_3(\theta)
```

```math
\mathcal{H}\mathcal{L}(\theta) = \mathcal{H}L_1(\theta) + \mathcal{H}L_2(\theta) + \mathcal{H} L_3(\theta)
```



#### Beta (β)

```math
Expand Down
2 changes: 1 addition & 1 deletion src/Metida.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Metida

using Distributions, LinearAlgebra, StatsBase, ForwardDiff, CategoricalArrays#, LoopVectorization
using Optim, LineSearches, MetidaBase
#using StatsModels
using StatsModels
import MetidaBase: Tables, MetidaModel, AbstractCovarianceStructure, AbstractCovmatMethod, AbstractCovarianceType, AbstractLMMDataBlocks, MetidaTable, metida_table, PrettyTables

import LinearAlgebra:checksquare
Expand Down

0 comments on commit e346fee

Please sign in to comment.