Skip to content

Instantly share code, notes, and snippets.

View jlegewie's full-sized avatar

Joscha Legewie jlegewie

View GitHub Profile
@jlegewie
jlegewie / dmvnorm_deriv_arma.Rmd
Last active December 22, 2015 14:28
First Derivative of the Multivariate Normal Densities with RcppArmadillo
---
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 December 10, 2015 10:19
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
jlegewie / README.md
Last active December 10, 2015 08:18 — forked from mbostock/.block
@jlegewie
jlegewie / send-selection-iterm.py
Created April 9, 2012 18:19
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):
@staticmethod
@jlegewie
jlegewie / R.sublime-completions
Created April 8, 2012 10:59
R Auto-completions in ST2
{
"scope": "source.r",
"completions":
[
"abline",
"abs",
"anova",
"anova.glm",
"anova.lm",
@jlegewie
jlegewie / example.html
Created March 30, 2012 06:57
deck.js: Large font size for full screen use creates reloading problem
<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">