Skip to content

Instantly share code, notes, and snippets.

View trappmartin's full-sized avatar
🧗

Martin Trapp trappmartin

🧗
View GitHub Profile
using Turing
using Optim
using UnicodePlots
import StatsBase.mode
@model gdemo_d() = begin
s ~ InverseGamma(2, 3)
m ~ Normal(0, sqrt(s))
1.5 ~ Normal(m, sqrt(s))
2.0 ~ Normal(m, sqrt(s))
using Turing, Turing.RandomMeasures
@model dpmixture(x) = begin
rpm = DirichletProcess(1.0)
n = zeros(Int, length(x))
z = zeros(Int, length(x))
for i in eachindex(x)
z[i] ~ ChineseRestaurantProcess(rpm, n)
n[z[i]] += 1
@trappmartin
trappmartin / gist:84ca6efbb8f47a6a36545da51894190c
Last active August 11, 2018 12:55
Change Julia 0.6 function syntax to Julia 1.0 using vim
%s/\({.*}\)\(([^)]*)\)\(\s=\)/\2 where \1\3/g
@trappmartin
trappmartin / vimrc
Last active July 17, 2018 16:56
.vimrc
set nocompatible
color pablo
syntax on
set number
set backspace=indent,eol,start
" highlight found words
set hlsearch
" show matching parenthesis
@trappmartin
trappmartin / .bashrc
Last active December 1, 2017 14:37
.bashrc config
#!/bin/bash
#######################################################
# EXPORTS
#######################################################
# Expand the history size
export HISTFILESIZE=10000
export HISTSIZE=500
# Set the default editor