++Tutorial: "Mathematical Transformations of Spatially Balanced Samples"#364
Open
falkmielke wants to merge 6 commits into
Open
++Tutorial: "Mathematical Transformations of Spatially Balanced Samples"#364falkmielke wants to merge 6 commits into
falkmielke wants to merge 6 commits into
Conversation
bserrien
reviewed
Jun 2, 2026
bserrien
left a comment
There was a problem hiding this comment.
Hi Falk, this is a very interesting tutorial! I am not an expert in spatial sampling (but I'm trying to learn it on my own), but everything is conceptually clear to me (I'll have to deal with the mathematics of Halton sequences another time). As a non-expert, I would mainly benefit from having more examples in the tutorial, maybe in the form of references to specific applications. Some examples:
- (3) Choose Your Distribution Pattern: And in many applications, it is a valid strategy to give points closer to the center a higher chance of being chosen [?? EXAMPLE ??], or to have a sampling pattern that reduces likelihood with distance from center, or just the opposite (i.e. bias towards the rim) [?? EXAMPLE ??].
- Spatial Balance - in a Weird Way: Close to the center, it is high, but it reduces towards the edges of our circle. Logical, if you think about it: the orbits close to the center are much shorter, yet they house equally many points as the distant orbits. This outcome might be fine in some situations [?? EXAMPLE ??], but undesired in others [?? EXAMPLE ??].
- If you would have real-life examples for the special variants (line 508 and further) that would be cool, but the tutorial is fine without.
On line 339 there is a typo: it refers to apply_transform but it was coded as apply_trafo.
Thanks for writing this nice tutorial!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A brief writeup of some useful tweaks I first implemented here for the MNM project.
I found this of general relevance, and spiced it up with references to spatially balanced sampling and basic application of functional programming.
Task list
tutorials/content/index.md. In case of an Rmarkdown tutorial I have knitted myindex.Rmdtoindex.md(both files are pushed to the repo).yamlheader:authorsyaml tag, using[MY_AUTHOR_ID]. An author information file exists in<tutorials>/data/authors/<author>.toml.categoriesto the YAML header and my category tags are from the list of categories.tags(i.e. keywords) in the YAML header to improve the visibility of the new tutorial (see the tags listed in the tutorials website side bar).dateis in formatYYYY-MM-DDand adjusted.Previewing the pull request
Thanks to GitHub Actions, an artifact (=zip file) of the rendered website is automatically created for each pull request.
This provides a way to preview how these updates will look on the website, useful to contributors and reviewers.
Instructions to preview the updated website
Downloads/tutorials_preview.httpsites on your local machine. One such option is theservrpackage in R:& '\C:\Program Files\R\R-4.4.2\bin\Rscript.exe' -e "servr::httd('./tutorials_preview')" -p8887(make sure to adjust the path to yourRscript.exe; on Linux, simply useRscript -e [...]).Note: for step 3, you can use any other simple HTTP server to serve the current directory, e.g. Python
http.server:python -m http.server 8887 --bind localhost --directory path/to/tutorials_previewAlternative: Locally Building the Site
Alternatively, you can build the entire site locally (see the README for instructions); the Hugo preview server will update changes on the fly.
This requires Hugo to be installed on your computer.