Skip to content

Instantly share code, notes, and snippets.

View simeoncarstens's full-sized avatar

Simeon Carstens simeoncarstens

View GitHub Profile
@simeoncarstens
simeoncarstens / emacs-pkg-install.sh
Created May 27, 2021 08:17 — forked from padawanphysicist/emacs-pkg-install.sh
Install emacs packages from the command-line
#!/bin/bash
#
# I wrapped the code constructed in
#
# http://hacks-galore.org/aleix/blog/archives/2013/01/08/install-emacs-packages-from-command-line
#
# in a single bash script, so I would a single code snippet.
#
# Package to be installed
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simeoncarstens
simeoncarstens / smc.ipynb
Last active January 27, 2020 14:21
Importance Sampling, Sequential Monte Carlo, Particle Filtering and stuff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simeoncarstens
simeoncarstens / binf.ipynb
Last active July 18, 2019 12:39
My personal solution for probabilistic programming: binf
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from numpy import sin, cos, arctan, sqrt, exp, random, pi, linspace
import matplotlib.pyplot as plt
def draw_sample(xold, sigma):
t = 3.0
vold = random.normal()
phi = arctan(-vold / xold * sigma)
A = vold * sigma * sqrt(xold ** 2 / sigma ** 2 / vold ** 2 + 1)
xnew = A * cos(t / sigma + phi)