Skip to content

Instantly share code, notes, and snippets.

View mhoehle's full-sized avatar

Michael Höhle mhoehle

View GitHub Profile
@mhoehle
mhoehle / wr3x3.R
Last active July 4, 2023 08:48
Statistical modelling of the 3x3 WR (single)
# We use statistical modelling to describe the development of
# the 3x3 world record (single) over time.
# Data from the WCA database are used.
#
# This post was inspired by a recent analysis made
# in a Youtube video by Jperm - see https://youtu.be/B9MKizs9PUw?t=451
#
# Author: Michael Höhle (https://math-inf.uni-greifswald.de/en/michael-hoehle/)
# Date: 2023-07-04
@mhoehle
mhoehle / cxx
Last active June 16, 2023 23:46
Check that 17 repeats of Lw' Uw' Lw Uw in a 3x3 Rubik's cube take you back to the starting configuration.
// hoehle 2023-06-17: Downloaded as "subgroup.tar.gz" from
// http://www.geometer.org/rubik/index.html
// in order to check that 17 repeats are needed
// for the move sequence described in
// https://twitter.com/Rainmaker1973/status/1669664486855176192?s=20
// (the sequence is Lw' Uw' Lw Uw)
// or in the notation of the program (line 92):
// char *grouplist[] = {"l*Ru*DL*LU*U", 0};
// Compile with g++ subgroup.cxx -o subgroup -Wc++11-compat-deprecated-writable-strings
@mhoehle
mhoehle / testthetester.R
Last active June 3, 2021 20:59
Teste den Schnelltester
#' Statistischer Test, ob Anteil positiver Test bei einem
#' Testanbieter kleiner ist als 1-Spez.
#'
#' Test von H_0: \pi >= 1-spez vs. H_1 \pi < 1-Spez
#' zum \alpha=0.025 Niveau.
ist_auffaellig <- function(pos_test, total_test, spez=0.997) {
t <- binomSamSize::binom.midp(pos_test, total_test, conf.level=0.95)
return( as.logical(t["upper"] < 1-spez))
}
@mhoehle
mhoehle / voc.R
Last active April 8, 2021 21:21
Sum of two exponential growths
# Quick mockup model to get expo-growth from variants based on
# a representative (?) sample of subtypes.
# Compare, e.g., with https://twitter.com/and_hi_/status/1370474726620008452/photo/1
#
# Author: Michael Höhle <https://www.math.su.se/~hoehle>
#
# Description:
# Data from Tab. 2 in https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/DESH/Bericht_VOC_2021-03-10.pdf?__blob=publicationFile
# as of 2021-03-11. VOC = B117
#
@mhoehle
mhoehle / survstat.R
Last active October 7, 2020 17:56
Make an age-stratified plot of the weekly COVID-19 incidence in Germany
#############################################################
# Illustrative script showing how to use SurvStat data
# to make an age-stratified COVID-19 incidence plot for Germany.
#
# Author: Michael Höhle <https://www.math.su.se/~hoehle>
# Date: 2020-10-07
# Code License: MIT (https://en.wikipedia.org/wiki/MIT_License)
#############################################################
# Load packages
---
title: "50 von 100,000 Notbremse innherhalb von 7 Tagen"
author: "Michael Höhle ([https://www.math.su.se/~hoehle](https://www.math.su.se/~hoehle))"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# Lade Pakete
##...
##run blog post code available as https://raw.githubusercontent.com/hoehleatsu/hoehleatsu.github.io/master/_source/2019-05-06-wcamining.Rmd
##...
######################################################################
## Determine proportion of female cubers
######################################################################
female_prop <- persons %>% group_by(id) %>% group_by(countryId) %>%
summarise(n_total=n(), n_male=sum(gender=="m"), n_female=sum(gender=="f")) %>%
@mhoehle
mhoehle / bday.R
Last active December 23, 2017 15:34
Small R script to extend analysis of https://www.reddit.com/r/dataisbeautiful/comments/7l9ef7/i_simulated_and_animated_500_instances_of_the/ using unequal occurrence probabilities
#####################################################################
## Small R script to extend analysis of
## https://www.reddit.com/r/dataisbeautiful/comments/7l9ef7/i_simulated_and_animated_500_instances_of_the/
## using unequal occurrence probabilities.
##
## Author: Michael Höhle <http://www.math.su.se/~hoehle>
## Date: 2017-12-23
## License: https://www.gnu.org/licenses/gpl-3.0.html
######################################################################