Skip to content

Commit

Permalink
build based on f765bb8
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 16, 2024
1 parent 2d52cd4 commit 3a510d3
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion previews/PR776/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.8.5","generation_timestamp":"2024-07-16T09:39:22","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.8.5","generation_timestamp":"2024-07-16T09:55:28","documenter_version":"1.5.0"}}
4 changes: 2 additions & 2 deletions previews/PR776/GaussHermite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
x=gh9[1], y=gh9[2], Geom.hair, Geom.point,
Scale.y_log2, Guide.ylabel("Weight (log scale)"),
Guide.xlabel(""),
)</code></pre><img src="fa35424f.svg" alt="Example block output"/><p>The definition of <code>MixedModels.GHnorm</code> is similar to the <code>gausshermitenorm</code> function with some extra provisions for ensuring symmetry of the abscissae and the weights and for caching values once they have been calculated.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MixedModels.GHnorm" href="#MixedModels.GHnorm"><code>MixedModels.GHnorm</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">GHnorm(k::Int)</code></pre><p>Return the (unique) GaussHermiteNormalized{k} object.</p><p>The function values are stored (memoized) when first evaluated. Subsequent evaluations for the same <code>k</code> have very low overhead.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaStats/MixedModels.jl/blob/d4a667602d439f2f122f9558cb21e3df08b86152/src/gausshermite.jl#L72-L79">source</a></section></article><pre><code class="language-julia hljs">using MixedModels
)</code></pre><img src="fa35424f.svg" alt="Example block output"/><p>The definition of <code>MixedModels.GHnorm</code> is similar to the <code>gausshermitenorm</code> function with some extra provisions for ensuring symmetry of the abscissae and the weights and for caching values once they have been calculated.</p><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="MixedModels.GHnorm" href="#MixedModels.GHnorm"><code>MixedModels.GHnorm</code></a><span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">GHnorm(k::Int)</code></pre><p>Return the (unique) GaussHermiteNormalized{k} object.</p><p>The function values are stored (memoized) when first evaluated. Subsequent evaluations for the same <code>k</code> have very low overhead.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaStats/MixedModels.jl/blob/f765bb898b93ad89a9f4f5f161a4cd0bd113a11c/src/gausshermite.jl#L72-L79">source</a></section></article><pre><code class="language-julia hljs">using MixedModels
GHnorm(3)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">MixedModels.GaussHermiteNormalized{3}([-1.7320508075688772, 0.0, 1.7320508075688772], [0.16666666666666666, 0.6666666666666666, 0.16666666666666666])</code></pre><p>By the properties of the normal distribution, when <span>$\mathcal{X}\sim\mathscr{N}(\mu, \sigma^2)$</span></p><p class="math-container">\[\mathbb{E}[g(x)] \approx \sum_{i=1}^k g(\mu + \sigma z_i)\,w_i\]</p><p>For example, <span>$\mathbb{E}[\mathcal{X}^2]$</span> where <span>$\mathcal{X}\sim\mathcal{N}(2, 3^2)$</span> is</p><pre><code class="language-julia hljs">μ = 2; σ = 3; ghn3 = GHnorm(3);
sum(@. ghn3.w * abs2(μ + σ * ghn3.z)) # should be μ² + σ² = 13</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">13.0</code></pre><p>(In general a dot, &#39;<code>.</code>&#39;, after the function name in a function call, as in <code>abs2.(...)</code>, or before an operator creates a <a href="https://docs.julialang.org/en/stable/manual/performance-tips/#More-dots:-Fuse-vectorized-operations-1"><em>fused vectorized</em></a> evaluation in Julia. The macro <code>@.</code> has the effect of vectorizing all operations in the subsequent expression.)</p><h2 id="Application-to-a-model-for-contraception-use"><a class="docs-heading-anchor" href="#Application-to-a-model-for-contraception-use">Application to a model for contraception use</a><a id="Application-to-a-model-for-contraception-use-1"></a><a class="docs-heading-anchor-permalink" href="#Application-to-a-model-for-contraception-use" title="Permalink"></a></h2><p>A <em>binary response</em> is a &quot;Yes&quot;/&quot;No&quot; type of answer. For example, in a 1989 fertility survey of women in Bangladesh (reported in <a href="https://www.popline.org/node/371841">Huq, N. M. and Cleland, J., 1990</a>) one response of interest was whether the woman used artificial contraception. Several covariates were recorded including the woman&#39;s age (centered at the mean), the number of live children the woman has had (in 4 categories: 0, 1, 2, and 3 or more), whether she lived in an urban setting, and the district in which she lived. The version of the data used here is that used in review of multilevel modeling software conducted by the Center for Multilevel Modelling, currently at University of Bristol (http://www.bristol.ac.uk/cmm/learning/mmsoftware/data-rev.html). These data are available as the <code>:contra</code> dataset.</p><pre><code class="language-julia hljs">contra = DataFrame(MixedModels.dataset(:contra))
describe(contra)</code></pre><div><div style = "float: left;"><span>5×7 DataFrame</span></div><div style = "clear: both;"></div></div><div class = "data-frame" style = "overflow-x: scroll;"><table class = "data-frame" style = "margin-bottom: 6px;"><thead><tr class = "header"><th class = "rowNumber" style = "font-weight: bold; text-align: right;">Row</th><th style = "text-align: left;">variable</th><th style = "text-align: left;">mean</th><th style = "text-align: left;">min</th><th style = "text-align: left;">median</th><th style = "text-align: left;">max</th><th style = "text-align: left;">nmissing</th><th style = "text-align: left;">eltype</th></tr><tr class = "subheader headerLastRow"><th class = "rowNumber" style = "font-weight: bold; text-align: right;"></th><th title = "Symbol" style = "text-align: left;">Symbol</th><th title = "Union{Nothing, Float64}" style = "text-align: left;">Union…</th><th title = "Any" style = "text-align: left;">Any</th><th title = "Union{Nothing, Float64}" style = "text-align: left;">Union…</th><th title = "Any" style = "text-align: left;">Any</th><th title = "Int64" style = "text-align: left;">Int64</th><th title = "DataType" style = "text-align: left;">DataType</th></tr></thead><tbody><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">1</td><td style = "text-align: left;">dist</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">D01</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">D61</td><td style = "text-align: right;">0</td><td style = "text-align: left;">String</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">2</td><td style = "text-align: left;">urban</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">N</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">Y</td><td style = "text-align: right;">0</td><td style = "text-align: left;">String</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">3</td><td style = "text-align: left;">livch</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">0</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">3+</td><td style = "text-align: right;">0</td><td style = "text-align: left;">String</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">4</td><td style = "text-align: left;">age</td><td style = "text-align: left;">0.00204757</td><td style = "text-align: left;">-13.56</td><td style = "text-align: left;">-1.56</td><td style = "text-align: left;">19.44</td><td style = "text-align: right;">0</td><td style = "text-align: left;">Float64</td></tr><tr><td class = "rowNumber" style = "font-weight: bold; text-align: right;">5</td><td style = "text-align: left;">use</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">N</td><td style = "font-style: italic; text-align: left;"></td><td style = "text-align: left;">Y</td><td style = "text-align: right;">0</td><td style = "text-align: left;">String</td></tr></tbody></table></div><p>A smoothed scatterplot of contraception use versus age</p><pre><code class="language-julia hljs">plot(contra, x=:age, y=:use, Geom.smooth, Guide.xlabel(&quot;Centered age (yr)&quot;),
Expand Down Expand Up @@ -1141,4 +1141,4 @@
</clipPath>
</defs>
</svg>
'/><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>https://en.wikipedia.org/wiki/Gaussian_quadrature</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../optimization/">« Details of the parameter estimation</a><a class="docs-footer-nextpage" href="../prediction/">Prediction and simulation in Mixed-Effects Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 09:39">Tuesday 16 July 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
'/><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>https://en.wikipedia.org/wiki/Gaussian_quadrature</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../optimization/">« Details of the parameter estimation</a><a class="docs-footer-nextpage" href="../prediction/">Prediction and simulation in Mixed-Effects Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 09:55">Tuesday 16 July 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
46 changes: 23 additions & 23 deletions previews/PR776/api/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion previews/PR776/benchmarks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
Load Avg: 1.4091796875 2.07080078125 1.63037109375
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)</code></pre></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 09:39">Tuesday 16 July 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)</code></pre></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Tuesday 16 July 2024 09:55">Tuesday 16 July 2024</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 3a510d3

Please sign in to comment.