Skip to content

Instantly share code, notes, and snippets.


Joscha Legewie jlegewie

View GitHub Profile
jlegewie / dmvnorm_deriv_arma.Rmd
Last active Dec 22, 2015
First Derivative of the Multivariate Normal Densities with RcppArmadillo
View dmvnorm_deriv_arma.Rmd
title: First Derivative of the Multivariate Normal Densities with RcppArmadillo
author: Joscha Legewie
license: GPL (>= 2)
tags: armadillo
summary: Fast implementation of the first derivative of the Multivariate Normal density using RcppArmadillo.
There is a great RcppArmadillo [implementation]( of multivariate normal densities. But I was looking for the first derivative of the multivariate normal densities. Good implementations are surprisingly hard to come by. I wasn't able to find any online and my first R implementations were pretty slow. RcppArmadillo might be a great alternative particularly because I am not aware of any c or Fortran implementations in R. In these areas, we can expect the largest performance gains. Indeed, the RcppArmadillo version is over 400-times faster than the R implementation!
jlegewie /
Last active Dec 10, 2015
Interactive approach to center view in map

Step two from Mike Bostock's excellent tutorial with interactive way to find the correct translation and scale, which makes it easy to display the desired part of the map. Click and move to position map, scroll to scale. The parameters are show in the console.

jlegewie /
Created Apr 9, 2012
Send selection from Sublime Text 2 to iTerm
import sublime
import sublime_plugin
#import os
import subprocess
import string
import re
## send selection to iTerm
class SendSelectionIterm(sublime_plugin.TextCommand):
jlegewie / R.sublime-completions
Created Apr 8, 2012
R Auto-completions in ST2
View R.sublime-completions
"scope": "source.r",
jlegewie / example.html
Created Mar 30, 2012
deck.js: Large font size for full screen use creates reloading problem
View example.html
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1024, user-scalable=no">
<!-- Core and extension CSS files -->
<link rel="stylesheet" href="/libs/deck/core/deck.core.css">