Skip to content

Commit

Permalink
build based on 4aedd7e
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 5, 2024
1 parent 26da0ae commit cf19454
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion previews/PR36/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-05T21:45:16","documenter_version":"1.4.1"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-05T22:16:05","documenter_version":"1.4.1"}}
4 changes: 2 additions & 2 deletions previews/PR36/compare/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using BenchmarkTools
const NNI = NaturalNeighbours</code></pre><p>We also define the following constants and other useful variables:</p><pre><code class="language-julia hljs">const itp_methods = (
Sibson(0),
Triangle(; allow_cache = true),
Triangle(),
Nearest(),
Laplace(),
Sibson(1),
Expand Down Expand Up @@ -567,4 +567,4 @@
2.187066 seconds (8.27 k allocations: 76.855 MiB, 0.36% compilation time)

julia&gt; @time itp(xq, yq; method = Hiyoshi(2));
13.762652 seconds (9.26 k allocations: 76.920 MiB, 0.06% compilation time)</code></pre><h1 id="Conclusion"><a class="docs-heading-anchor" href="#Conclusion">Conclusion</a><a id="Conclusion-1"></a><a class="docs-heading-anchor-permalink" href="#Conclusion" title="Permalink"></a></h1><p>Overall, the smooth interpolants have the best performance, with <code>Farin(1)</code> and <code>Hiyoshi(2)</code> typically beating most interpolants. <code>Hiyoshi(2)</code> is much slower than the other interpolants, though, and <code>Farin(1)</code> may be a preferable interpolant if <span>$C^1$</span> continuity at the data sites is sufficient. For generating derivatives, the <code>Direct()</code> seems to beat the results with the <code>Iterative()</code> method in most situations.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../swiss/">« Switzerland Elevation Data</a><a class="docs-footer-nextpage" href="../interpolation_math/">Interpolation Details »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 21:45">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
13.762652 seconds (9.26 k allocations: 76.920 MiB, 0.06% compilation time)</code></pre><h1 id="Conclusion"><a class="docs-heading-anchor" href="#Conclusion">Conclusion</a><a id="Conclusion-1"></a><a class="docs-heading-anchor-permalink" href="#Conclusion" title="Permalink"></a></h1><p>Overall, the smooth interpolants have the best performance, with <code>Farin(1)</code> and <code>Hiyoshi(2)</code> typically beating most interpolants. <code>Hiyoshi(2)</code> is much slower than the other interpolants, though, and <code>Farin(1)</code> may be a preferable interpolant if <span>$C^1$</span> continuity at the data sites is sufficient. For generating derivatives, the <code>Direct()</code> seems to beat the results with the <code>Iterative()</code> method in most situations.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../swiss/">« Switzerland Elevation Data</a><a class="docs-footer-nextpage" href="../interpolation_math/">Interpolation Details »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 22:16">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
4 changes: 2 additions & 2 deletions previews/PR36/differentiation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
fig, ε = plot_gradients(∇g, f′, xg, yg)</code></pre><pre><code class="language-julia-repl hljs">julia&gt; ε
13.185747607565729</code></pre><figure>
<img src='../figures/gradient_surface.png', alt'Evaluated Gradient'><br>
</figure><p>There are of course some strange artifacts near the convex hull, but the results are not terrible. Let&#39;s see what happens to the error if we instead use the other interpolant methods.</p><pre><code class="language-julia hljs">other_methods = [Sibson(), Laplace(), Nearest(), Triangle(; allow_cache = true)]
</figure><p>There are of course some strange artifacts near the convex hull, but the results are not terrible. Let&#39;s see what happens to the error if we instead use the other interpolant methods.</p><pre><code class="language-julia hljs">other_methods = [Sibson(), Laplace(), Nearest(), Triangle()]
∇gs = [∂(_x, _y; interpolant_method=method) for method in other_methods]
∇f = [f′(x, y) for x in xg, y in yg]
εs = [rrmserr(∇f, collect.(∇g)) for ∇g in ∇gs]</code></pre><pre><code class="language-julia-repl hljs">julia&gt; hcat(other_methods, εs)
Expand Down Expand Up @@ -248,4 +248,4 @@
7.479964687679311

julia&gt; εH_nohull = rrmserr(f′′.(_x, _y), to_mat.(Hg), ∂, _x, _y)
38.884740966379056</code></pre><p>The errors are smaller, though not by much.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../interpolation/">« Interpolation</a><a class="docs-footer-nextpage" href="../swiss/">Switzerland Elevation Data »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 21:45">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
38.884740966379056</code></pre><p>The errors are smaller, though not by much.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../interpolation/">« Interpolation</a><a class="docs-footer-nextpage" href="../swiss/">Switzerland Elevation Data »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 22:16">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion previews/PR36/differentiation_math/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
\overline{\boldsymbol g}_1 &amp;= \gamma_i^\prime g_{i1}, \\
\overline{\boldsymbol g}_2 &amp;= \gamma_i^\prime g_{i2}, \\
\boldsymbol{\bm\theta} &amp;= \begin{bmatrix} \frac{\partial f(\boldsymbol x_0)}{\partial x} &amp; \frac{\partial f(\boldsymbol x_0)}{\partial y} &amp; \frac{\partial^2 f(\boldsymbol x_0)}{\partial x^2} &amp; \frac{\partial f(\boldsymbol x_0)}{\partial y^2} &amp; \frac{\partial f(\boldsymbol x_0)}{\partial x\partial y} \end{bmatrix}^T.
\end{align*}\]</p><p>To solve this linear system, let</p><p class="math-container">\[\boldsymbol D = \begin{bmatrix} \overline{\boldsymbol A} \\ \overline{\boldsymbol B} \\ \overline{\boldsymbol C} \end{bmatrix}, \quad \boldsymbol c = \begin{bmatrix} \overline{\boldsymbol w} \\ \overline{\boldsymbol g}_1 \\ \overline{\boldsymbol g}_2 \end{bmatrix},\]</p><p>so that <span>$\boldsymbol D^T\boldsymbol D\boldsymbol\theta = \boldsymbol D^T\boldsymbol c$</span>. These are just the normal equations for <span>$\boldsymbol D\boldsymbol \theta = \boldsymbol c$</span>, thus we can estimate the gradients and Hessians by simply solving <span>$\boldsymbol D\boldsymbol \theta = \boldsymbol c$</span>.</p><h1 id="Generation-Away-from-the-Data-Sites"><a class="docs-heading-anchor" href="#Generation-Away-from-the-Data-Sites">Generation Away from the Data Sites</a><a id="Generation-Away-from-the-Data-Sites-1"></a><a class="docs-heading-anchor-permalink" href="#Generation-Away-from-the-Data-Sites" title="Permalink"></a></h1><p>It is possible to extend these ideas so that we can approximate the derivative at any point <span>$\boldsymbol x_0 \in \mathcal C(\boldsymbol X)$</span>. Using the associated interpolant, simply approximate <span>$z_0$</span> with the value of the interpolant at <span>$\boldsymbol x_0$</span>, and then replace <span>$W_i$</span> by <span>$\lambda_i/\|\boldsymbol x_i-\boldsymbol x_0\|$</span>, where <span>$\lambda_i$</span> is the Sibson coordinate at <span>$\boldsymbol x_i$</span> relative to <span>$\boldsymbol x_0$</span>. If using a direct approach to approximate gradients and Hessians, Sibson coordinates cannot be used (because you can&#39;t extend the weights out to <span>$N_0^2$</span>) and so <span>$W_i$</span> remains as is in that case. Note that the <span>$N_0$</span> neighbourhoods are now the sets of natural neighbours.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../interpolation_math/">« Interpolation Details</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 21:45">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
\end{align*}\]</p><p>To solve this linear system, let</p><p class="math-container">\[\boldsymbol D = \begin{bmatrix} \overline{\boldsymbol A} \\ \overline{\boldsymbol B} \\ \overline{\boldsymbol C} \end{bmatrix}, \quad \boldsymbol c = \begin{bmatrix} \overline{\boldsymbol w} \\ \overline{\boldsymbol g}_1 \\ \overline{\boldsymbol g}_2 \end{bmatrix},\]</p><p>so that <span>$\boldsymbol D^T\boldsymbol D\boldsymbol\theta = \boldsymbol D^T\boldsymbol c$</span>. These are just the normal equations for <span>$\boldsymbol D\boldsymbol \theta = \boldsymbol c$</span>, thus we can estimate the gradients and Hessians by simply solving <span>$\boldsymbol D\boldsymbol \theta = \boldsymbol c$</span>.</p><h1 id="Generation-Away-from-the-Data-Sites"><a class="docs-heading-anchor" href="#Generation-Away-from-the-Data-Sites">Generation Away from the Data Sites</a><a id="Generation-Away-from-the-Data-Sites-1"></a><a class="docs-heading-anchor-permalink" href="#Generation-Away-from-the-Data-Sites" title="Permalink"></a></h1><p>It is possible to extend these ideas so that we can approximate the derivative at any point <span>$\boldsymbol x_0 \in \mathcal C(\boldsymbol X)$</span>. Using the associated interpolant, simply approximate <span>$z_0$</span> with the value of the interpolant at <span>$\boldsymbol x_0$</span>, and then replace <span>$W_i$</span> by <span>$\lambda_i/\|\boldsymbol x_i-\boldsymbol x_0\|$</span>, where <span>$\lambda_i$</span> is the Sibson coordinate at <span>$\boldsymbol x_i$</span> relative to <span>$\boldsymbol x_0$</span>. If using a direct approach to approximate gradients and Hessians, Sibson coordinates cannot be used (because you can&#39;t extend the weights out to <span>$N_0^2$</span>) and so <span>$W_i$</span> remains as is in that case. Note that the <span>$N_0$</span> neighbourhoods are now the sets of natural neighbours.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../interpolation_math/">« Interpolation Details</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 5 July 2024 22:16">Friday 5 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit cf19454

Please sign in to comment.