diff --git a/.nojekyll b/.nojekyll index a024cc2..e0e37b5 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -2cf701c9 \ No newline at end of file +66a04540 \ No newline at end of file diff --git a/aGHQ.html b/aGHQ.html index 14f1e15..f9b9733 100644 --- a/aGHQ.html +++ b/aGHQ.html @@ -2,7 +2,7 @@ - + @@ -507,12 +507,12 @@

βm05 = copy(com05.β)
6-element Vector{Float64}:
- -0.3414913998306781
-  0.3936080536502067
-  0.6064861079468472
- -0.012911714642169572
-  0.03321662487439253
- -0.005625046845040066
+ -0.3414675499274024 + 0.3936022945891755 + 0.6064521635960723 + -0.01291017393458232 + 0.03321086562324279 + -0.00562465124007457

As stated above, the meanunitdev function can be applied to the vectors, \({\mathbf{y}}\) and \({{\boldsymbol{\eta}}}\), via dot-vectorization to produce a Vector{NamedTuple}, which is the typical form of a row-table.

@@ -530,23 +530,23 @@

sum(r.dev for r in rowtbl)
-
2411.194470806229
+
2411.1933707496587
@@ -628,7 +628,7 @@

deviance(setβ!(com05fe, βm05))
-
2411.194470806229
+
2411.1933707496587

For fairness in later comparisons we restore the initial values β₀ to the model. These are rough starting estimates with a deviance that is considerably greater than that at βm05.

deviance(setβ!(com05fe, β₀))
-
2491.1514390537254
+
2491.151439053725
@@ -669,7 +669,7 @@

fit!(com05fe);
-
[ Info: (code = :ROUNDOFF_LIMITED, nevals = 558, minf = 2409.377428160017)
+
[ Info: (code = :ROUNDOFF_LIMITED, nevals = 535, minf = 2409.377428160018)

The optimizer has determined a coefficient vector that reduces the deviance to 2409.38, at which point convergence was declared because changes in the objective are limited by round-off. This required about 500 evaluations of the deviance at candidate values of \({\boldsymbol{\beta}}\).

@@ -680,13 +680,13 @@

(m = com05fe; β = βopt)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
- Range (min … max):  33.798 μs … 113.439 μs  ┊ GC (min … max): 0.00% … 0.00%
- Time  (median):     36.778 μs               ┊ GC (median):    0.00%
- Time  (mean ± σ):   36.707 μs ±   1.706 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
+ Range (min … max):  34.239 μs … 79.352 μs  ┊ GC (min … max): 0.00% … 0.00%
+ Time  (median):     35.081 μs              ┊ GC (median):    0.00%
+ Time  (mean ± σ):   35.674 μs ±  3.225 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
 
-   ▂        ▁      ▁▃▆▂      ▄▇█▂        ▁▁                    ▂
-  ▆█▇▁▁▁▁▁▆▇█▅▄▁▃▄▃████▄▁▁▃▃▅████▇▅▄▆▅▄▆▆███▇▅▆▅▅▅▃▁▄▄▃▃▃▄▅▅▆▆ █
-  33.8 μs       Histogram: log(frequency) by time        40 μs <
+  ▅▁█▅▂                                                       ▁
+  █████▇▇▇███▇▇███▇▇▆▇▆▆▆▆▆▆▅▆▆▅▅▅▅▄▃▄▅▄▅▃▃▁▁▃▄▄▅▇▆▆▆▃▄▁▃▃▄▅▅ █
+  34.2 μs      Histogram: log(frequency) by time      53.1 μs <
 
  Memory estimate: 16 bytes, allocs estimate: 1.
@@ -857,9 +857,9 @@

fit!(com05fe, β₀);
[ Info: (0, 2491.1514390537254)
-[ Info: (1, 2411.165742459929)
+[ Info: (1, 2411.1657424599293)
 [ Info: (2, 2409.382451337132)
-[ Info: (3, 2409.3774282835857)
+[ Info: (3, 2409.377428283585)
 [ Info: (4, 2409.3774281600413)
@@ -867,14 +867,14 @@

@benchmark deviance(updateβ!(m)) seconds = 1 setup = (m = com05fe)
-
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
- Range (min … max):  67.528 μs … 161.118 μs  ┊ GC (min … max): 0.00% … 0.00%
- Time  (median):     76.638 μs               ┊ GC (median):    0.00%
- Time  (mean ± σ):   76.986 μs ±   2.640 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
+
BenchmarkTools.Trial: 7372 samples with 1 evaluation.
+ Range (min … max):  126.577 μs … 294.077 μs  ┊ GC (min … max): 0.00% … 0.00%
+ Time  (median):     130.825 μs               ┊ GC (median):    0.00%
+ Time  (mean ± σ):   133.084 μs ±  12.228 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
 
-                         ▂▂▂▄▅▅▄▇██▆▅▄▄▅▅▄▃▂▂▂▂▂▁▁▁            ▂
-  ▅▅▆▆▇▇▇▆▆▆▆▆▆▆▅▆▇▇▇██▇██████████████████████████████▇▇▇▇▇▇▇▇ █
-  67.5 μs       Histogram: log(frequency) by time      84.5 μs <
+  ▇▇▇▆█▇▄▄▃▂▂▁                                                  ▂
+  ██████████████▇█▇▇▇▇▇▇▆▆▅▅▆▆▆▆▂▅▄▅▄▅▆▅▆▆▅▅▆▅▇▅▅▆▆▅▅▅▆▆▆▄▅▄▄▅▄ █
+  127 μs        Histogram: log(frequency) by time        189 μs <
 
  Memory estimate: 16.12 KiB, allocs estimate: 6.
@@ -1052,14 +1052,14 @@

m = BernoulliPIRLS(com05.X, com05.y, only(com05.reterms).refs)
 pdeviance(m)
-
2409.377428160041
+
2409.3774281600413

As with IRLS, the first iteration of PIRLS reduces the objective, which is the penalized deviance in this case, substantially.

pdeviance(updateu!(m))
-
2233.1209476357844
+
2233.1209476357853

Create a pirls! method for this struct.

@@ -1094,9 +1094,9 @@

pirls!(m; verbose=true);
-
[ Info: (0, 2409.377428160041)
-[ Info: (1, 2233.1209476357844)
-[ Info: (2, 2231.605935279706)
+
[ Info: (0, 2409.3774281600413)
+[ Info: (1, 2233.1209476357853)
+[ Info: (2, 2231.6059352797065)
 [ Info: (3, 2231.6002198321576)
 [ Info: (4, 2231.600219406561)
@@ -1105,14 +1105,14 @@

@benchmark pirls!(mm) seconds = 1 setup = (mm = m)
-
BenchmarkTools.Trial: 4402 samples with 1 evaluation.
- Range (min … max):  199.693 μs … 331.599 μs  ┊ GC (min … max): 0.00% … 0.00%
- Time  (median):     227.186 μs               ┊ GC (median):    0.00%
- Time  (mean ± σ):   226.091 μs ±   5.569 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
+
BenchmarkTools.Trial: 3848 samples with 1 evaluation.
+ Range (min … max):  237.623 μs … 461.619 μs  ┊ GC (min … max): 0.00% … 0.00%
+ Time  (median):     243.844 μs               ┊ GC (median):    0.00%
+ Time  (mean ± σ):   257.466 μs ±  31.167 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%
 
-                                        ▁         ▇█             
-  ▂▂▂▂▁▂▂▂▂▂▂▂▂▂▂▁▁▂▂▂▁▂▁▂▂▁▁▂▂▂▂▁▂▁▁▁▁▄█▄▄▃▂▃▃▃▃▃██▇▆▃▃▅▄▃▂▂▂▂ ▃
-  200 μs           Histogram: frequency by time          234 μs <
+  ▅▁█▆▃      ▁     ▁▁ ▁                      ▁                   
+  ██████▇██▇████████████▇▇▆▇▆▆▅▆▆▅▅▅▅▆▅▆▅▅▆▅▅█▇▇█▆▅▂▄▃▅▅▄▄▄▃▅▄▄ █
+  238 μs        Histogram: log(frequency) by time        383 μs <
 
  Memory estimate: 112 bytes, allocs estimate: 1.
@@ -1188,7 +1188,7 @@

fit!(m);
-
[ Info: (ret = :ROUNDOFF_LIMITED, fevals = 550, minf = 2354.4744815688055)
+
[ Info: (ret = :ROUNDOFF_LIMITED, fevals = 539, minf = 2354.4744815688023)
@@ -1202,7 +1202,7 @@

)

-
Converged to θ = 0.5683043594028967 and β =[-0.3409777149845993, 0.3933796201906975, 0.6064857599227369, -0.012926172564277872, 0.03323478854784157, -0.005626184982660486]
+
Converged to θ = 0.5683043828108765 and β =[-0.34097751800164144, 0.3933797121269934, 0.6064857490620532, -0.012926173063985653, 0.03323479562652116, -0.005626186061473733]

These estimates differ somewhat from those for model com05.

@@ -1219,7 +1219,7 @@

)
-
Estimates for com05: θ = 0.5761507901895634, fmin = 2353.8241980539815, and β =[-0.3414913998306781, 0.3936080536502067, 0.6064861079468472, -0.012911714642169572, 0.03321662487439253, -0.005625046845040066]
+
Estimates for com05: θ = 0.5761308007138215, fmin = 2353.8241975622855, and β =[-0.3414675499274024, 0.3936022945891755, 0.6064521635960723, -0.01291017393458232, 0.03321086562324279, -0.00562465124007457]

The discrepancy in the results is because the com05 results are based on a more accurate approximation to the integral called adaptive Gauss-Hermite Quadrature, which is discussed in Section C.6.

@@ -1448,7 +1448,7 @@

- +
Figure C.3: Change in the penalized deviance contribution from that at the conditional mode, for each of the first 5 groups, in model com05, as a function of u. @@ -1582,7 +1582,7 @@

- +
Figure C.5: The difference between the contribution to the penalized deviance and its quadratic approximation for each of first 5 groups in model com05 as a function of z. @@ -1616,7 +1616,7 @@

- +
Figure C.6: Exponential of half the difference between the quadratic approximation and the contribution to the penalized deviance, for each of first 5 groups in model com05 as a function of z. @@ -1667,11 +1667,11 @@

extrema(m.utbl.aGHQ)
-
(-0.008514108854172236, -0.0004132698576107887)
+
(-0.008514109511364184, -0.0004132697962170406)

As we see, these “correction terms” relative to Laplace’s approximation are relatively small, compared to the contributions to the objective from each component of \({\mathbf{u}}\). Also, the corrections are all negative, in this case. Close examination of the individual curves in Figure C.5 shows that these curves, which are \(-2\log(f_j(z))\), are more-or-less odd functions, in the sense that the value at \(-z\) is approximately the negative of the value at \(z\). If we were integrating \(\log(f_j(z_j))\phi(z_j)\) with a normalized Gauss-Hermite rule the negative and positive values would cancel out, for the most part, and some of the integrals would be positive while others would be negative.

@@ -1732,21 +1732,21 @@

7-element Vector{Float64}:
-  0.5761321679271924
- -0.3414655990254175
-  0.39359939391066806
-  0.6064447618771712
- -0.012909685721680265
-  0.03320994962034241
- -0.005624606329593786
+ 0.5761321422331179 + -0.3414655647634521 + 0.39359933036111444 + 0.6064446768742858 + -0.012909673161244401 + 0.033209939096054776 + -0.0056246062539383156 -

This page was rendered from git revision 05a171b +

This page was rendered from git revision a091925 .

diff --git a/datatables.html b/datatables.html index db512e1..667b5ee 100644 --- a/datatables.html +++ b/datatables.html @@ -2,7 +2,7 @@ - + @@ -716,8 +716,8 @@

<

The JuliaData organization manages the development of several packages related to data science and data management, including DataFrames.jl, a comprehensive system for working with column-oriented data tables in Julia. Kamiński (2023), written by the primary author of that package, provides an in-depth introduction to data science facilities, in particular the DataFrames package, in Julia.

This package is particularly well-suited to more advanced data manipulation such as the split-apply-combine strategy (Wickham, 2011) and “joins” of data tables.

Bouchet-Valat & Kamiński (2023) compares the performance of DataFrames.jl to other data frame implementations in R and Python.

-

This page was rendered from git revision 05a171b +

This page was rendered from git revision a091925 .

diff --git a/glmmbernoulli.html b/glmmbernoulli.html index 1bba742..e1712df 100644 --- a/glmmbernoulli.html +++ b/glmmbernoulli.html @@ -2,7 +2,7 @@ - + @@ -534,10 +534,10 @@

(Intercept) --0.0126 +-0.0128 0.1058 -0.12 -0.9052 +0.9038 0.4787 @@ -545,12 +545,12 @@

0.1532 0.0982 1.56 -0.1188 +0.1187 livch: 2 -0.2561 +0.2562 0.1045 2.45 0.0142 @@ -558,7 +558,7 @@

livch: 3+ -0.2590 +0.2591 0.1022 2.53 0.0113 @@ -568,15 +568,15 @@

age 0.0006 0.0095 -0.07 -0.9466 +0.06 +0.9483 abs2(age) -0.0047 0.0008 --6.13 +-6.12 <1e-09 @@ -593,7 +593,7 @@

-0.0067 0.0069 -0.98 -0.3261 +0.3257 @@ -601,7 +601,7 @@

-0.0004 0.0007 -0.51 -0.6075 +0.6079 @@ -768,7 +768,7 @@

-0.2194 0.1155 -1.90 -0.0576 +0.0575 0.4773 @@ -784,12 +784,12 @@

0.0035 0.0082 0.43 -0.6674 +0.6673 urban: Y -0.3734 +0.3733 0.0801 4.66 <1e-05 @@ -808,7 +808,7 @@

-0.0068 0.0069 -0.99 -0.3231 +0.3227 @@ -816,7 +816,7 @@

-0.0004 0.0007 -0.49 -0.6261 +0.6272 @@ -880,7 +880,7 @@

(Intercept) --0.2302 +-0.2303 0.1140 -2.02 0.0434 @@ -888,7 +888,7 @@

urban: Y -0.3461 +0.3462 0.0599 5.78 <1e-08 @@ -907,7 +907,7 @@

0.0063 0.0078 0.80 -0.4249 +0.4247 @@ -1034,7 +1034,7 @@

-0.0131 0.0110 -1.19 -0.2351 +0.2353 @@ -1131,7 +1131,7 @@

ch: true -0.6065 +0.6064 0.1045 5.80 <1e-08 @@ -1142,7 +1142,7 @@

-0.0129 0.0112 -1.16 -0.2470 +0.2471 @@ -1182,21 +1182,21 @@

Table with 4 columns and 44 rows: age ch urban η ┌───────────────────────────── - 1 │ -10 false N -1.44276 + 1 │ -10 false N -1.44278 2 │ -7 false N -1.29428 - 3 │ -4 false N -1.24704 - 4 │ -1 false N -1.30104 - 5 │ 2 false N -1.45629 - 6 │ 5 false N -1.71278 - 7 │ 8 false N -2.07051 - 8 │ 11 false N -2.52948 - 9 │ 14 false N -3.0897 - 10 │ 17 false N -3.75115 - 11 │ 20 false N -4.51385 - 12 │ -10 true N -0.894068 - 13 │ -7 true N -0.546316 - 14 │ -4 true N -0.299807 - 15 │ -1 true N -0.15454 - 16 │ 2 true N -0.110516 - 17 │ 5 true N -0.167734 + 3 │ -4 false N -1.24703 + 4 │ -1 false N -1.30102 + 5 │ 2 false N -1.45626 + 6 │ 5 false N -1.71273 + 7 │ 8 false N -2.07045 + 8 │ 11 false N -2.52941 + 9 │ 14 false N -3.08962 + 10 │ 17 false N -3.75107 + 11 │ 20 false N -4.51376 + 12 │ -10 true N -0.894085 + 13 │ -7 true N -0.546331 + 14 │ -4 true N -0.299819 + 15 │ -1 true N -0.15455 + 16 │ 2 true N -0.110524 + 17 │ 5 true N -0.167741 ⋮ │ ⋮ ⋮ ⋮ ⋮ @@ -1346,7 +1346,7 @@

- +
Figure 6.3: Linear predictor versus centered age from model com05 @@ -1411,23 +1411,23 @@

<
Table with 5 columns and 44 rows:
       age  ch     urban  η          μ
     ┌────────────────────────────────────────
- 1  │ -10  false  N      -1.44276   0.191118
+ 1  │ -10  false  N      -1.44278   0.191116
  2  │ -7   false  N      -1.29428   0.215129
- 3  │ -4   false  N      -1.24704   0.223213
- 4  │ -1   false  N      -1.30104   0.213989
- 5  │ 2    false  N      -1.45629   0.189035
- 6  │ 5    false  N      -1.71278   0.152804
- 7  │ 8    false  N      -2.07051   0.111996
- 8  │ 11   false  N      -2.52948   0.0738171
- 9  │ 14   false  N      -3.0897    0.0435342
- 10 │ 17   false  N      -3.75115   0.0229515
- 11 │ 20   false  N      -4.51385   0.0108374
- 12 │ -10  true   N      -0.894068  0.290271
- 13 │ -7   true   N      -0.546316  0.366719
- 14 │ -4   true   N      -0.299807  0.425605
- 15 │ -1   true   N      -0.15454   0.461442
- 16 │ 2    true   N      -0.110516  0.472399
- 17 │ 5    true   N      -0.167734  0.458164
+ 3  │ -4   false  N      -1.24703   0.223215
+ 4  │ -1   false  N      -1.30102   0.213993
+ 5  │ 2    false  N      -1.45626   0.189041
+ 6  │ 5    false  N      -1.71273   0.15281
+ 7  │ 8    false  N      -2.07045   0.112002
+ 8  │ 11   false  N      -2.52941   0.0738216
+ 9  │ 14   false  N      -3.08962   0.0435374
+ 10 │ 17   false  N      -3.75107   0.0229534
+ 11 │ 20   false  N      -4.51376   0.0108384
+ 12 │ -10  true   N      -0.894085  0.290267
+ 13 │ -7   true   N      -0.546331  0.366716
+ 14 │ -4   true   N      -0.299819  0.425602
+ 15 │ -1   true   N      -0.15455   0.461439
+ 16 │ 2    true   N      -0.110524  0.472397
+ 17 │ 5    true   N      -0.167741  0.458163
  ⋮  │  ⋮     ⋮      ⋮        ⋮          ⋮
@@ -1450,7 +1450,7 @@

<
- +
Figure 6.5: Predicted probability of contraception use versus centered age from model com05. @@ -1466,10 +1466,10 @@

<
Table with 5 columns and 4 rows:
      age  ch     urban  η          μ
    ┌───────────────────────────────────────
- 1 │ 2    false  N      -1.45629   0.189035
- 2 │ 2    true   N      -0.110516  0.472399
- 3 │ 2    false  Y      -0.669101  0.338698
- 4 │ 2    true   Y      0.676673   0.662996
+ 1 │ 2 false N -1.45626 0.189041 + 2 │ 2 true N -0.110524 0.472397 + 3 │ 2 false Y -0.669056 0.338708 + 4 │ 2 true Y 0.676675 0.662996

The predicted probability of woman with centered age of 2, with children, living in an urban environment using artificial contraception is about 2/3, which is reasonably close to the smoothed frequency for that combination of covariates in Figure 6.2.

@@ -1487,7 +1487,7 @@

- +
Figure 6.6: Caterpillar plot of the conditional modes of the random-effects for model com05 @@ -1506,12 +1506,12 @@

Table with 2 columns and 6 rows: dist & urban (Intercept) ┌────────────────────────── - 1 │ ("D01", "N") -0.957366 - 2 │ ("D11", "N") -0.93198 - 3 │ ("D24", "N") -0.603418 - 4 │ ("D01", "Y") -0.580203 - 5 │ ("D27", "N") -0.576647 - 6 │ ("D55", "Y") -0.548261 + 1 │ ("D01", "N") -0.95737 + 2 │ ("D11", "N") -0.931988 + 3 │ ("D24", "N") -0.603424 + 4 │ ("D01", "Y") -0.580204 + 5 │ ("D27", "N") -0.57665 + 6 │ ("D55", "Y") -0.548267
@@ -1520,12 +1520,12 @@

Table with 2 columns and 6 rows: dist & urban (Intercept) ┌────────────────────────── - 1 │ ("D43", "N") 0.64408 - 2 │ ("D04", "Y") 0.644669 - 3 │ ("D42", "N") 0.665114 - 4 │ ("D58", "N") 0.677418 - 5 │ ("D14", "Y") 0.695322 - 6 │ ("D34", "N") 1.08591 + 1 │ ("D43", "N") 0.644084 + 2 │ ("D04", "Y") 0.644675 + 3 │ ("D42", "N") 0.665122 + 4 │ ("D58", "N") 0.677423 + 5 │ ("D14", "Y") 0.695323 + 6 │ ("D34", "N") 1.08592

The largest random effect is for rural settings in D34. There were 26 women in the sample from rural D34

@@ -1565,12 +1565,12 @@

exp(last(first(srtdre)))
-
0.38390287360272524
+
0.3839013481790906

or about 40%.

-

This page was rendered from git revision 05a171b +

This page was rendered from git revision a091925 .

diff --git a/index.html b/index.html index efb2049..56480db 100644 --- a/index.html +++ b/index.html @@ -2,14 +2,14 @@ - + - + Embrace Uncertainty