From 7c593a199ce4d97c4003e00524eaf99fc96ccc5a Mon Sep 17 00:00:00 2001 From: Douglas Bates Date: Fri, 2 Mar 2018 11:00:50 -0600 Subject: [PATCH] Update to BlockArrays v0.3.0, ambiguous stderr --- REQUIRE | 2 +- src/pls.jl | 4 ++-- test/pls.jl | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/REQUIRE b/REQUIRE index ffebe3286..8ea837378 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,6 +1,6 @@ julia 0.6.1 ArgCheck -BlockArrays +BlockArrays 0.3.0 CategoricalArrays DataFrames 0.11.0 Distributions 0.11 diff --git a/src/pls.jl b/src/pls.jl index 894dffdf2..fb8826e5d 100644 --- a/src/pls.jl +++ b/src/pls.jl @@ -31,8 +31,8 @@ function LinearMixedModel(f, trms, wts) reweight!.(trms, Vector[sqrtwts]) end nt = length(trms) - A = BlockArray(AbstractMatrix{T}, sz, sz) - L = BlockArray(AbstractMatrix{T}, sz, sz) + A = BlockArrays._BlockArray(AbstractMatrix{T}, sz, sz) + L = BlockArrays._BlockArray(AbstractMatrix{T}, sz, sz) for j in 1:nt, i in j:nt Lij = L[Block(i,j)] = densify(trms[i]'trms[j]) A[Block(i,j)] = deepcopy(isa(Lij, BlockedSparse) ? Lij.cscmat : Lij) diff --git a/test/pls.jl b/test/pls.jl index e4027cdef..9fdfc456d 100644 --- a/test/pls.jl +++ b/test/pls.jl @@ -46,7 +46,7 @@ end @test isapprox(logdet(fm1), 8.06014522999825, atol=0.001) @test isapprox(varest(fm1), 2451.2501089607676, atol=0.001) @test isapprox(pwrss(fm1), 73537.49947885796, atol=0.001) - @test isapprox(stderr(fm1), [17.69455188898009], atol=0.0001) + @test isapprox(StatsBase.stderr(fm1), [17.69455188898009], atol=0.0001) vc = VarCorr(fm1) show(IOBuffer(), vc) @@ -62,7 +62,7 @@ end @test objective(fm) ≈ 162.87303665382575 @test abs(std(fm)[1][1]) < 1.0e-9 @test std(fm)[2] ≈ [3.653231351374652] - @test stderr(fm) ≈ [0.6669857396443261] + @test StatsBase.stderr(fm) ≈ [0.6669857396443261] @test coef(fm) ≈ [5.6656] @test logdet(fm) ≈ 0.0 refit!(fm, dat[:Dyestuff][:Y]) @@ -81,7 +81,7 @@ end @test isapprox(coef(fm), [22.97222222222222], atol=0.001) @test isapprox(fixef(fm), [22.97222222222222], atol=0.001) @test coef(fm)[1] ≈ mean(dat[:Penicillin][:Y]) - @test isapprox(stderr(fm), [0.7445960346851368], atol=0.0001) + @test isapprox(StatsBase.stderr(fm), [0.7445960346851368], atol=0.0001) @test isapprox(getθ(fm), [1.5375772376554968, 3.219751321180035], atol=0.001) @test isapprox(std(fm)[1], [0.8455645948223015], atol=0.0001) @test isapprox(std(fm)[2], [1.770647779277388], atol=0.0001) @@ -103,7 +103,7 @@ end @test isapprox(objective(fm), 247.99446586289676, atol=0.001) @test isapprox(coef(fm), [60.05333333333329], atol=0.001) @test isapprox(fixef(fm), [60.05333333333329], atol=0.001) - @test isapprox(stderr(fm), [0.6421359883527029] , atol=0.0001) + @test isapprox(StatsBase.stderr(fm), [0.6421359883527029] , atol=0.0001) @test isapprox(getθ(fm), [3.5268858714382905, 1.3299230213750168], atol=0.001) @test isapprox(std(fm)[1], [2.904069002535747], atol=0.001) @test isapprox(std(fm)[2], [1.095070371687089], atol=0.0001) @@ -155,10 +155,10 @@ end @test isapprox(getθ(fm), [0.929221307, 0.01816838, 0.22264487096], atol=1.e-6) @test isapprox(pwrss(fm), 117889.46144025437) @test isapprox(logdet(fm), 73.90322021999222, atol=0.001) - @test isapprox(stderr(fm), [6.632257721914501, 1.5022354739749826], atol=0.0001) + @test isapprox(StatsBase.stderr(fm), [6.632257721914501, 1.5022354739749826], atol=0.0001) @test coef(fm) ≈ [251.40510484848477,10.4672859595959] @test fixef(fm) ≈ [10.4672859595959, 251.40510484848477] - @test isapprox(stderr(fm), [6.632246393963571, 1.502190605041084], atol=0.01) + @test isapprox(StatsBase.stderr(fm), [6.632246393963571, 1.502190605041084], atol=0.01) @test isapprox(std(fm)[1], [23.780468100188497, 5.716827903196682], atol=0.01) @test isapprox(logdet(fm), 73.90337187545992, atol=0.001) @test diag(cor(fm)[1]) ≈ ones(2) @@ -190,7 +190,7 @@ end @test isapprox(objective(fmnc), 1752.0032551398835, atol=0.001) @test coef(fmnc) ≈ [251.40510484848585, 10.467285959595715] @test fixef(fmnc) ≈ [10.467285959595715, 251.40510484848477] - @test isapprox(stderr(fmnc), [6.707710260366577, 1.5193083237479683], atol=0.001) + @test isapprox(StatsBase.stderr(fmnc), [6.707710260366577, 1.5193083237479683], atol=0.001) @test isapprox(getθ(fmnc), [0.9458106880922268, 0.22692826607677266], atol=0.0001) @test std(fmnc)[1] ≈ [24.171449463289047, 5.799379721123582] @test std(fmnc)[2] ≈ [25.556130034081047]