Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaStats/MixedModels.jl into gl…
Browse files Browse the repository at this point in the history
…mm_dispersion_deviance
  • Loading branch information
palday committed Oct 29, 2020
2 parents fed8b01 + 0bf61a2 commit c4d3fa4
Show file tree
Hide file tree
Showing 34 changed files with 636 additions and 298 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
name: CompatHelper

on:
schedule:
- cron: '43 7 * * *'

- cron: 43 7 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.2.0]
julia-arch: [x86]
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
3 changes: 0 additions & 3 deletions .github/workflows/Future.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
release:
types:
- created
jobs:
ci:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: TagBot
on:
schedule:
- cron: 5 * * * *
workflow_dispatch:
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }} # see https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#GitHub-Actions
14 changes: 2 additions & 12 deletions .github/workflows/Tier1.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tier1
name: Tier 1
on:
push:
branches:
Expand All @@ -12,9 +12,6 @@ on:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
release:
types:
- created
jobs:
ci:
runs-on: ${{ matrix.os }}
Expand All @@ -33,11 +30,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: julia-actions/julia-uploadcodecov@v0.1
if: startsWith(matrix.os, 'Ubuntu')
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: julia-actions/julia-docdeploy@releases/v1
if: ${{ startsWith(matrix.os, 'Ubuntu') && startsWith(matrix.julia-version, '1.5') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
if: ${{ startsWith(matrix.os, 'Ubuntu') && startsWith(matrix.julia-version, '1.5') }}
19 changes: 19 additions & 0 deletions .github/workflows/documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Documenter
on:
push:
branches: [master]
tags: [v*]
pull_request:
branches:
- master
jobs:
Documenter:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
10 changes: 5 additions & 5 deletions Artifacts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
[TestData]
# compute this using
# using Tar, Inflate, SHA
# filename = "download?version=2" # I just used wget for the URL below and this is how it saved it
# filename = "download?version=4" # I just used wget for the URL below and this is how it saved it
# println("sha256: ", bytes2hex(open(sha256, filename)))
# println("git-tree-sha1: ", Tar.tree_hash(IOBuffer(inflate_gzip(filename))))
# from https://julialang.github.io/Pkg.jl/dev/artifacts/
git-tree-sha1 = "a3955a5f747d01e628944b1031b44e31f027ebef"
git-tree-sha1 = "75260d131b693f26e5834adf855f4c35d627348d"
lazy = true

[[TestData.download]]
# this is the SHA from https://osf.io/djaqb/download?version=2
sha256 = "b6273f0cfeb5b12e2afede33de6d68a8d926e7b684cf071c7622f1e6ef7aa64a"
# this is the SHA from https://osf.io/djaqb/download?version=4
sha256 = "d179cadfb27fc638fd8a06b0d58f5f2916f786c5719ab22de93fedb6129726f4"
# when updating this, make sure to change to change the version number,
# because if the version number isn't included, it will always point to the
# latest version, which means it will break existing users when we update
# between releases.
url = "https://osf.io/djaqb/download?version=2"
url = "https://osf.io/djaqb/download?version=4"

# for future work on using xz-compressed data:
# Julia invokes wget without using HTTP metadata, so we need the link
Expand Down
21 changes: 17 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
MixedModels v3.1 Release Notes
========================

* `simulate!` and thus `parametricbootstrap` methods for `GeneralizedLinearMixedModel` [#418].
* Documented inconsistent behavior in `sdest` and `varest` `GeneralizedLinearMixedModel` [#418].

MixedModels v3.0.2 Release Notes
========================

* Compatibility updates
* Minor updates for formatting in various `show` method for `VarCorr`.

MixedModels v3.0 Release Notes
========================

Expand Down Expand Up @@ -43,12 +55,12 @@ Principal components
----------------------------------

* An `AbstractReMat` type has now been introduced to support [#380] work on constrained
random-effects structures and random-effects structures appropriate for applications
in GLM-based decovolution as used in fMRI and EEG (see e.g. [unfold.jl](https://github.com/unfoldtoolbox/unfold.jl).)
random-effects structures and random-effects structures appropriate for applications
in GLM-based decovolution as used in fMRI and EEG (see e.g. [unfold.jl](https://github.com/unfoldtoolbox/unfold.jl).)
* Similarly, a constructor for `FeMat{::SparseMatrixCSC,S}` has been introduced [#309].
Currently, this constructor assumes a full-rank matrix, but the work on rank
Currently, this constructor assumes a full-rank matrix, but the work on rank
deficiency may be extended to this constructor as well.
* Analogous to `AbstractReMat`, an `AbstractReTerm <: AbstractTerm` type has been introduced [#395].
* Analogous to `AbstractReMat`, an `AbstractReTerm <: AbstractTerm` type has been introduced [#395].
Terms created with `zerocorr` are of type `ZeroCorr <: AbstractReTerm`.

Availability of test data sets
Expand Down Expand Up @@ -85,3 +97,4 @@ Package dependencies
[#384]: https://github.com/JuliaStats/MixedModels.jl/issues/384
[#390]: https://github.com/JuliaStats/MixedModels.jl/issues/390
[#395]: https://github.com/JuliaStats/MixedModels.jl/issues/395
[#418]: https://github.com/JuliaStats/MixedModels.jl/issues/418
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MixedModels"
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
author = ["Phillip Alday <me@phillipalday.com>", "Douglas Bates <dmbates@gmail.com>", "Jose Bayoan Santiago Calderon <jbs3hp@virginia.edu>"]
version = "3.0.0-DEV"
version = "3.1.0"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand All @@ -24,10 +24,10 @@ StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
Arrow = "0.3"
Arrow = "0.3, 0.4"
BlockArrays = "0.11, 0.12"
DataAPI = "1.1, 1.2, 1.3"
Distributions = "0.21, 0.22, 0.23"
Distributions = "0.21, 0.22, 0.23, 0.24"
GLM = "1"
NLopt = "0.5, 0.6"
PooledArrays = "0.5"
Expand Down
144 changes: 98 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,52 +49,104 @@ Typical distribution forms are _Bernoulli_ for binary data or _Poisson_ for coun

|OS|OS Version|Arch|Julia|Tier|
|:-:|:-:|:-:|:-:|:-:|
|Linux|Ubuntu 18.04|x64|v1.4|1|
|macOS|Catalina 10.15|x64|v1.4|1|
|Windows|Server 2019|x64|v1.4|1|
|Linux|Ubuntu 18.04|x86|v1.4|2|
|Windows|Server 2019|x86|v1.4|2|

## Version 2.0.0

Version 2.0.0 contains some user-visible changes and many changes in the underlying code.

The user-visible changes include:

- Update formula specification to `StatsModels v"0.6.2"`, allowing for function calls within the fixed-effects terms and for interaction terms on the left-hand side of a random-effects term.

- Use of properties in a model in addition to extractor functions. For example, to obtain the covariance parameter, $\theta$, from a model, the recommended approach now is to access the `θ` property, as in `m.θ`, instead of the extractor `getθ(m)`.

- `bootstrap` is now named `parametricbootstrap` to avoid conflict with a similar name in the `Bootstrap` package. The bootstrap sample is returned as a `Table`.

- A `fit` method for the abstract type `MixedModel` has been added. It is called as

```
julia> using Tables, MixedModels
julia> Dyestuff = columntable((batch = string.(repeat('A':'F', inner=5)),
yield = [1545, 1440, 1440, 1520, 1580, 1540, 1555, 1490, 1560, 1495, 1595, 1550, 1605,
1510, 1560, 1445, 1440, 1595, 1465, 1545, 1595, 1630, 1515, 1635, 1625, 1520, 1455,
1450, 1480, 1445]));
julia> m1 = fit(MixedModel, @formula(yield ~ 1 + (1|batch)), Dyestuff)
Linear mixed model fit by maximum likelihood
yield ~ 1 + (1 | batch)
logLik -2 logLik AIC BIC
-163.66353 327.32706 333.32706 337.53065
Variance components:
Column Variance Std.Dev.
batch (Intercept) 1388.3334 37.260347
Residual 2451.2500 49.510100
Number of obs: 30; levels of grouping factors: 6
Fixed-effects parameters:
──────────────────────────────────────────────────
Estimate Std.Error z value P(>|z|)
──────────────────────────────────────────────────
(Intercept) 1527.5 17.6946 86.326 <1e-99
──────────────────────────────────────────────────
|Linux|Ubuntu 18.04|x64|v1.4, 1.5|1|
|macOS|Catalina 10.15|x64|v1.4, 1.5|1|
|Windows|Server 2019|x64|v1.4, 1.5 |1|

Upon release of the next Julia LTS, Tier 1 will become Tier 2 and Julia LTS will become Tier 1.

## Version 3.0.0

Version 3.0.0 contains some user-visible changes and many changes in the underlying code.

Please see [NEWS](NEWS.md) for a complete overview.
The most dramatic user-facing change is a re-working of `parametricbootstrap` for speed and convenience.
Additionally, several formula features have been added and [the handling of rank deficiency has changed](https://juliastats.org/MixedModels.jl/dev/rankdeficiency/).

## Quick Start
```julia-repl
julia> using MixedModels
julia> m1 = fit(MixedModel, @formula(yield ~ 1 + (1|batch)), MixedModels.dataset(:dyestuff))
Linear mixed model fit by maximum likelihood
yield ~ 1 + (1 | batch)
logLik -2 logLik AIC BIC
-163.6635 327.3271 333.3271 337.5307
Variance components:
Column VarianceStd.Dev.
batch (Intercept) 1388.33 37.2603
Residual 2451.25 49.5101
Number of obs: 30; levels of grouping factors: 6
Fixed-effects parameters:
────────────────────────────────────────────────
Coef. Std. Error z Pr(>|z|)
────────────────────────────────────────────────
(Intercept) 1527.5 17.6946 86.33 <1e-99
────────────────────────────────────────────────
julia> using Random
julia> bs = parametricbootstrap(MersenneTwister(42), 1000, m1);
Progress: 100%%|████████████████████████████████████████████████| Time: 0:00:00
julia> propertynames(bs)
13-element Vector{Symbol}:
:allpars
:objective
:se
:coefpvalues
:σs
:inds
:lowerbd
:bstr
:fcnames
julia> bs.coefpvalues # returns a row table
1000-element Vector{NamedTuple{(:iter, :coefname, :β, :se, :z, :p), Tuple{Int64, Symbol, Float64, Float64, Float64, Float64}}}:
(iter = 1, coefname = Symbol("(Intercept)"), β = 1517.0670832927115, se = 20.76271142094811, z = 73.0669059804057, p = 0.0)
(iter = 2, coefname = Symbol("(Intercept)"), β = 1503.5781855888436, se = 8.1387737362628, z = 184.7425956676446, p = 0.0)
(iter = 3, coefname = Symbol("(Intercept)"), β = 1529.2236379016574, se = 16.523824785737837, z = 92.54659001356465, p = 0.0)
(iter = 998, coefname = Symbol("(Intercept)"), β = 1498.3795009457242, se = 25.649682012258104, z = 58.417079019913054, p = 0.0)
(iter = 999, coefname = Symbol("(Intercept)"), β = 1526.1076747922416, se = 16.22412120273579, z = 94.06411945042063, p = 0.0)
(iter = 1000, coefname = Symbol("(Intercept)"), β = 1557.7546433870125, se = 12.557577103806015, z = 124.04898098653763, p = 0.0)
julia> using DataFrames
julia> DataFrame(bs.coefpvalues) # puts it into a DataFrame
1000×6 DataFrame
│ Row │ iter │ coefname │ β │ se │ z │ p │
│ │ Int64 │ Symbol │ Float64 │ Float64 │ Float64 │ Float64 │
├──────┼───────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ 1 │ 1 │ (Intercept) │ 1517.07 │ 20.7627 │ 73.0669 │ 0.0 │
│ 2 │ 2 │ (Intercept) │ 1503.58 │ 8.13877 │ 184.743 │ 0.0 │
│ 3 │ 3 │ (Intercept) │ 1529.22 │ 16.5238 │ 92.5466 │ 0.0 │
│ 998 │ 998 │ (Intercept) │ 1498.38 │ 25.6497 │ 58.4171 │ 0.0 │
│ 999 │ 999 │ (Intercept) │ 1526.11 │ 16.2241 │ 94.0641 │ 0.0 │
│ 1000 │ 1000 │ (Intercept) │ 1557.75 │ 12.5576 │ 124.049 │ 0.0 │
julia> DataFrame(bs.β)
1000×3 DataFrame
│ Row │ iter │ coefname │ β │
│ │ Int64 │ Symbol │ Float64 │
├──────┼───────┼─────────────┼─────────┤
│ 1 │ 1 │ (Intercept) │ 1517.07 │
│ 2 │ 2 │ (Intercept) │ 1503.58 │
│ 3 │ 3 │ (Intercept) │ 1529.22 │
│ 998 │ 998 │ (Intercept) │ 1498.38 │
│ 999 │ 999 │ (Intercept) │ 1526.11 │
│ 1000 │ 1000 │ (Intercept) │ 1557.75 │
```

## Funding Acknowledgement

The development of this package was supported by the Center for Interdisciplinary Research, Bielefeld (ZiF)/Cooperation Group "Statistical models for psychological and linguistic data".
4 changes: 4 additions & 0 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
MixedModels = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
3 changes: 0 additions & 3 deletions benchmark/REQUIRE

This file was deleted.

1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using MixedModels
makedocs(
root = joinpath(dirname(pathof(MixedModels)), "..", "docs"),
sitename = "MixedModels",
doctest = true,
pages = [
"index.md",
"constructors.md",
Expand Down
Loading

0 comments on commit c4d3fa4

Please sign in to comment.