We use cookies

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

Seb’s blog
  • About
  • Posts
Categories
All (99)
ANOVA vs t-Tests (1)
Algorithmic study design (4)
Linear model vs neural nets (4)
Mishmash (7)
Observable (1)
Psychiatry (2)
Python (15)
Quarto (1)
R (61)
Self-study (7)
Sustainibility (8)
survival (1)

Blog posts

Moran process

R
  • Malignant clone outcompetes own cell type
  • Malignant clone outcompetes other needed cell types
  • Malignant clone causes inflammation
  • Malignant clone does other “bad” things…
Sep 16, 2025

Assessing linearity in logistic regression

R
https://chatgpt.com/share/6851c5ad-9c08-8013-ad26-d03c0de42079
Jul 30, 2025

 

Left censored predictors

R
set.seed(1)
library('tidyverse')

n <- 1000000
beta <- 0.1
dat <- tibble(x = runif(n, min = -6, max = 0),
              slope = runif(n, 0, 0.1),
              lql = -3, #…
Jul 1, 2025

Model diagnostics in logistic regression

R
  • Previous related post
  • Background from chatGPT
Jun 19, 2025

Zahlenmauern

R
# i: row of Zahlenmauer
# j: j-th entry of Zahlenmauer

i_j_to_ii <- function(i, j) {
  ii <- 0
  if(i > 1) {
    ii <- ii + sum(1:(i - 1))
  }
  return(ii + j)
}

ii_to_i_j …

Apr 26, 2025

Genetic algorithm

R
  • We want to fit a model with parameters to data
  • Given: Data points and a function to calculate a loss function for a given parameter set
  • What we don’t have: Derivative of…
Mar 12, 2025

Profiling in R and Julia

R
library('tidyverse')
Dec 22, 2024

ODE benchmark: R, Python and Julia

R
library('tidyverse')

library('reticulate')
use_condaenv('sbloggel')

library('JuliaCall')
julia_setup(JULIA_HOME = '/Users/seb/.juliaup/bin/')

set.seed(1)
Dec 17, 2024

 

Saving output from R terminal

R
In order to save output from within R, the sink commmand usually can do the job. Have a look also at the help page.
Dec 16, 2024

 

Comparing counts

R
We can construct an approximate, pragmatic statistical test. The test statistic k=x2−x1 follows approximately (asymptotically with growing λ1 and \(\lamb…
Dec 6, 2024

 

Neue Klimaabschätzungen

Sustainibility
Ergo: Wenn es gelänge die Sahara komplett aufzuforsten, würde das ungefähr 10% des von Menschen emittierten CO2 gleich wieder binden!
Nov 13, 2024

 

Python Enhancement Proposals – Style guide, Type hints and Docstring Conventions

Python
Python Enhancement Proposals (PEPs)
Nov 11, 2024

 

Dal

Mishmash
Für ein schmackhaftes Dal für 3 Personen:
Nov 8, 2024

 

Parameter class in Python

Python
class param:
    def __init__(self, **kwargs):
        for key, value in kwargs.items():
            setattr(self, key, value)
            
p = param(a=2, b = 3)
print('a ='…
Nov 8, 2024

 

Speed of ODE solving in R and Python

Python
import time

# Start the timer
start_time = time.time()

# Your code block
# Example:
for i in range(1000000):
    pass

# End the timer
end_time = time.time()

# Calculate…
Nov 7, 2024

 

Speed of ODE solving in R and Python

R
# Load the deSolve package
library(deSolve)

# Define the SIR model
sir_model <- function(time, state, parameters) {
  with(as.list(c(state, parameters)), {
    dS <- -beta *…
Nov 1, 2024

 

Regal

Mishmash
  • Innenmaß 336 mm
  • Außenholz 15 mm
  • Innenholz 12 mm
  • Tiefe oben 415 mm
  • Tiefe unten 390 mm
  • Oct 25, 2024

     

    Energy consumption of artificial intelligence

    R
    Oct 24, 2024

     

    Ventilation

    Mishmash
    Sustainibility
    How much water in liters is removed from a flat with a volume if the air in the flat is changed?
    Oct 23, 2024

     

    Energie Haus

    Sustainibility
    Der Quotient aus beiden:
    Oct 23, 2024

    gglimpse or tibblet, tlimpse or dfsum

    R
    All in all, I like the summarytools package – however – I don’t like its heavy dependencies. Here, I want to create a lightweight alternative!
    Sep 30, 2024

     

    Hypothesis testing in mixed linear models with a factorial design

    R
    dat <- expand_grid(time = factor(1:3), group = factor(1:2), ID = 1:5) |> 
      mutate(hh = paste('time', time, 'group', group, sep = '_'))
    
    X <- model.matrix(~ hh + factor(ID), …
    Sep 30, 2024

     

    Pi mal Daumen - Elektromobilität

    R
    Sustainibility
    (J_per_kWh <- 1e3 * 3.6e3)
    [1] 3600000
    Sep 30, 2024

    Energie

    Sustainibility
    Also PV-Fläche pro Person benötigt:
    Sep 24, 2024

    Testing the package summarytools

    R
    Data Frame Summary
    iris
    Dimensions: 150 x 5
    Duplicates: 1
    Sep 17, 2024
    No matching items
    • 1
    • 2
    • 3
    • ...
     
    • View source
    Cookie Preferences