Skip to content

Instantly share code, notes, and snippets.

Avatar

Joscha Legewie jlegewie

View GitHub Profile
@jlegewie
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](http://gallery.rcpp.org/articles/dmvnorm_arma/) 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
jlegewie / README.md
Last active Dec 10, 2015
Interactive approach to center view in map
View README.md

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