Posts by Year

2024

Hosting things on my Synology NAS

I use the domain elhult.duckdns.org to host things for private use. It points to my NAS, a DS214+ running DSM 7.1 from Synology. It is useful for backing up ...

A proof for the back-door criterion

A very common way to quantify a causal effect is inverse-probability-weighting (IPW) with back door adjustment. You can find the method described in many pla...

Back to Top ↑

2023

Functools Partial

Partial application We have a function f(a,b) but we want to fix the values of b some value, and get a new function of a only. In pseudocode, we want to sa...

Documenting correctness in Haskell

In the Functional Programming 1 course we teach at Uppsala University, there is some confusion about how to document code. Every year, there is confusion. I ...

How fast get you read the BNO055?

I am trying to collect some high frequency accelerometer data for a machine learning hobby project. Since I had the Adafruit BNO055 board lying around, that ...

Back to Top ↑

2022

How to Log, with Scikit-Learn

I recently dug deep in to logging and scikit-learn. It lead to a SO question, and a few hours later, noone but me has attempted a solution. I thought I would...

Nonparametric prediction intervals

There is a simple formula for a onesided nonparametric prediction interval under exchangeable data. One can derive it very directly under iid assumptions, an...

Classical OLS

[\def\E{{\mathbb E}} \def\R{{\mathbb R}} \def\betaTrue{{\beta_{\circ}}} \def\eye{I} \def\coloneqq{:=} \def\eqqcolon{=:} \def\rank{\operato...

Empirical Bernstein Bounds

In machine learning, we often rely on the possibility to estimate an expectation by a sample mean. One example is the hope that a model selected by empirica...

CVaR, VaR and quantiles

There are funny concept in mathematical finance, that have strange abbreviations and funny names. It seems part of the problem is that one tries to capture ...

Back to Top ↑

2021

On Haskell Builds

Currently, Im about to finish my AoC 2016 code in Haskell. The main motivation is that I will be Teaching Assistant in a Functional Programming course this f...

Jekyll Minial Mistakes

Today I migrated to Minimal-Mistakes, quite possiblu the most common Jekyll theme for personal blogs in the ML-AI clique. I realized it was worth it to migra...

Reflections on the Bregman Divergence

Reading arXiv:2008.01883v2 I was thinking a little about the Bregman Divergence. It is a measure of distance sometimes used in probability theory that I am n...

Recording videos as a TA

As a PhD student, I am often a teaching assistant (TA) in the courses tought at my department. With the covid-19-pandemic as a driver, we have more and more ...

An invertible BatchNormalizer1D

In Normalizing Flows, you might want to normalize the data at some point. Either in the input layer, because you want your model to learn the data normaliza...

Installation project: New radio

I am writing this as a note for memory regarind the installation of a new head unit in my Citroen C3 from 2002. I write as I research, so I’m by far no exper...

Some standard tricks for LaTeX

There is a bunch of things I have repeatedly been looking up over the last months. Here they are - as a kind of easy-to-find repository of snippets.

Some nix-trix

So today I tried to run some stuff on a Ubuntu server from my Windows 10 machine. I did it in four steps that I liked, and that I wanted to write down for fu...

Some exploration of conda

I’ve spent almost a full day battling conda. My goal was to have a simple environment.yml file that I could conda env create --file environment.yml both on m...

GitHub Pages with MathJax

So I thought I’d write a line about how it is to have a first experience in using GitHub Pages and enabling MathJax. I had not used Jekyll at all before, so ...

Back to Top ↑