Pavel N. Krivitsky
krivitsky.net
Pavel N. Krivitsky
@krivitsky.net
Inveterate 🕸 modeller
𝑃(🦋; 𝜽) = 𝘩(🦋) exp{𝜼(𝜽) · 𝒔(🦋)} / 𝜅(𝜽)
👨🏻‍🏫 Statistics at UNSW 🇦🇺
👨🏻‍💻 10 #RStats 📦
ex-🪑 @ANSNA.org.au

https://krivitsky.net
https://statnet.org
https://github.com/krivit
So, this is what the typical first line would look like:

sim <- piecemeal::Piecemeal$new(dir)

or

sim <- Piecemeal::Piecemeal$new(dir)

Thoughts?
September 12, 2025 at 7:05 AM
Getting this ready for #CRAN, a quick poll: should I call it {piecemeal} or {Piecemeal}? It's basically one #R6 class, `Piecemeal`, e.g.,

sim <- Piecemeal$new(tmpdir) # Initialise
sim$worker(f)$nrep(5)$ etc. # Set up
sim$run() # Execute
results <- sim$result_df() # Collate
September 12, 2025 at 7:05 AM
krivitsky.net/sunbelt2025/ is now linked from sunbelt2025.org by @sunbelt2025paris.bsky.social l . Double-checking the code now... 😅
June 26, 2025 at 6:34 AM
This list is based on the PDF you can export from Whova, which I hopefully parsed correctly. It is in no way endorsed by @insna.bsky.social or @sunbelt2025paris.bsky.social 's organisers. I will strive to keep it up to date throughout the conference, but the updates are not automatic.
June 25, 2025 at 1:46 PM
There are also more utilities for PSD matrix calculations, particularly for computing xᵀV⁻¹x, taking into account that:

* base::solve() treats diag(c(1e10, 1e-10)) as computationally singular.

* Even when V is, in fact, singular, a unique and sensible answer still exists if x is in the span of V.
May 30, 2025 at 11:13 AM
A helper function modify_in_place() for easily implementing functions that robustly modify their arguments in place (without resorting to environments a la #R6). E.g.,

> inc <- function(x){
modify_in_place(x, x+1)
}
> x <- 1:3
inc(x[1])
> x
[1] 2 2 3
May 30, 2025 at 11:13 AM
New functions include statnet.common::replace(x, list, values) a drop-in replacement for the {base} function that can take function arguments for list= and values= so that, e.g.,

x |> replace(is.na, 0)

does exactly what you would want it to, as does `replace<-`, for

replace(x, is.na) <- 0

.
May 30, 2025 at 11:13 AM
Granted #Bioconductor 's S4Vectors::Rle() almost certainly does everything that {rle} does but better, but it also means depending on Bioconductor. Is it no longer the hassle that it used to be?
May 30, 2025 at 1:29 AM
This is really cool! I've been using US election maps to illustrate the point in my Data Viz class, but I suppose it's long past time to localise.
May 4, 2025 at 12:59 PM
I suspect that most of us (statistical methodologists) already have loose code that does something like this, borrowed or evolved over the course of our careers.

I tried to make the whole process user-friendly and robust, so we won't need to reinvent this particular wheel again.
April 14, 2025 at 4:55 AM
If a particular run produces an error, the simulation continues; the error can be identified, reproduced, and debugged. If the whole job runs out of time, the next one can pick up where it left off. You can even submit multiple identical jobs, and they will seamlessly avoid each other's runs.
April 14, 2025 at 4:55 AM
The basic idea: rather than running the simulation code on the cluster directly and then returning its output, wrap it in code that takes the output (or its error info) and saves it to an RDS file unique to that treatment combination and replication. These can then be loaded and collated.
April 14, 2025 at 4:55 AM