Skip to content

Instantly share code, notes, and snippets.

View fabian-s's full-sized avatar
🐒

Fabian Scheipl fabian-s

🐒
View GitHub Profile
library(beepr)
countdown <- function(length, rep, main) {
sapply(length : 1, function(t) {
plot(0, 0, cex = NA,
main =paste0(main, ": REP ", rep),
bty = "n", xaxt = "n", yaxt = "n",
cex.main = 6)
text(0, 0, t, cex = 10)
Sys.sleep(1)
% Introduction to Machine Learning
% Day 3
% Set style/preamble.Rnw as parent.
<<set-parent, include = FALSE>>=
knitr::set_parent("../style/preamble.Rnw")
@
% Load all R packages and set up knitr
<<setup, child="../style/setup.Rnw", include = FALSE>>=
options(error=traceback, deparse.max.lines = 10)
library("gamboostLSS")
library("gamlss")
# y ~ Binomial(p = invlogit(x + z), n= 60)
n <- 100
x <- rnorm(n)
z <- rnorm(n)
data <- data.frame(y = rbinom(n, p = plogis(x + z), size = 60), x = x, z= z)
@fabian-s
fabian-s / 2014-03-21-simple-array-class.Rmd
Last active August 29, 2015 13:57
Rcpp Gallery: Arrray class & some specialized linear algebra for arrays
---
title: A simple array class with specialized linear algebra routines
author: Fabian Scheipl
license: GPL (>= 2)
tags: modeling, armadillo
summary: Define a simple array class for implementing Currie/Durban/Eilers "generalized linear array models".
---
[Currie, Durban and Eilers](http://www.macs.hw.ac.uk/~iain/research/RSSB.2006.pdf) write:
@fabian-s
fabian-s / 2014-03-20-dynamic-dispatch-for-sparse-matrices.Rmd
Created March 20, 2014 15:06
Rcpp Gallery: Dynamic dispatch for sparse matrices
---
title: Dynamic dispatch for sparse matrices
author: Fabian Scheipl
license: GPL (>= 2)
tags: sparse
summary: Define a matrix multiplication function for "sparse times dense" and "dense times dense".
---
We want to do matrix multiplication for 3 cases: