Skip to content

spatial/variograms errata: Wrapping, Gauss instead of Matérn, formatting#374

Merged
falkmielke merged 2 commits into
masterfrom
variograms_errata
May 27, 2026
Merged

spatial/variograms errata: Wrapping, Gauss instead of Matérn, formatting#374
falkmielke merged 2 commits into
masterfrom
variograms_errata

Conversation

@falkmielke
Copy link
Copy Markdown
Contributor

This PR corrects minor errors in the tutorial on spatial analysis / variograms.

  • There was a putative error in the interval wrapping function; I have double checked the new one in a separate article (linked as footnote; but the link is optional -> feel free to remove).
  • formatting: space missing before a quote
  • reference to a wrong distribution function

This has very minor implications for the actual (randomly generated) data.
Therefore, I suggest to not re-calculate and re-commit the figure binaries.
(Instead, I have simply corrected the respective code lines.)

@falkmielke falkmielke added the bug label Apr 1, 2026
@falkmielke falkmielke changed the title variograms_errata: (wip) Gauss instead of Matérn spatial/variograms errata: Wrapping, Gauss instead of Matérn, formatting Apr 1, 2026
@falkmielke
Copy link
Copy Markdown
Contributor Author

(The commit message says "wip", but no more progress is required: this is ready for review and merge. Thank you in advance!)

Copy link
Copy Markdown

@bserrien bserrien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Falk, the .qmd and the index.md file now contain different code for the wrap_difference() function. I believe the index.md file is correct (%% extent). Should the two not be the same? Is the space you imagine for this wrapping something like the game of snake?

@falkmielke
Copy link
Copy Markdown
Contributor Author

falkmielke commented May 26, 2026

Hello Falk, the .qmd and the index.md file now contain different code for the wrap_difference() function. [...] Should the two not be the same?

Indeed. Thank you for checking @bserrien , and sorry that I missed that!

I believe the index.md file is correct (%% extent).

Which of the two formulas is correct depends on the usage of extent on the rest of the code (and whether extend is defined as half or full wrapping period). Here, spatial positions can be positive and negative, and thus the full period (analogous: "diameter") is twice the extent, and we shift by 1* extent ("radius").

Just to make sure, I have tried rendering both versions again.

((Y - X + (extent/2)) %% (extent)) - (extent/2) produces the following wraps:
image
... clearly there is some unwanted periodicity with half the extent.

Conclusion that the formula in .qmd was correct, it must be: ((Y - X + (extent)) %% (2*extent)) - (extent))
image

Is the space you imagine for this wrapping something like the game of snake?

Nice analogy; and maybe the availability of old nokia phones in my teens has lead to a subconscious "snake" image. But that was not my first thought.

Copy link
Copy Markdown

@bserrien bserrien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Falk, thanks for correcting me on the modulo. I will now approve the revision.

@falkmielke falkmielke merged commit 7e9fb10 into master May 27, 2026
1 check passed
@falkmielke falkmielke deleted the variograms_errata branch May 27, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants