Skip to content

Instantly share code, notes, and snippets.

View floswald's full-sized avatar
👋

Florian Oswald floswald

👋
View GitHub Profile
@floswald
floswald / julia_nim_cpp_r_sir.md
Created April 24, 2020 15:24 — forked from sdwfrost/julia_nim_cpp_r_sir.md
Comparing simple simulations in Julia, Nim, C++ and R

This gist compares the performance of Julia, Nim, C++ and R - the latter using either POMP, or LibBi in a simple simulation of an SIR epidemiological model. In addition to keeping track of susceptibles, infecteds and recovereds, I also store the cumulative number of infections. Time moves in discrete steps, and the algorithm avoids language-specific syntax features to make the comparison as fair as possible, including using the same algorithm for generating binomial random numbers and the same random number generator; the exception are the R versions, POMP uses the standard R Mersenne Twister for the random number generator; I'm not sure what LibBi uses. The algorithm for generating random binomial numbers is only really suitable for small np.

Benchmarks were run on a Mac Pro (Late 2013), with 3 Ghz 8-core Intel Xeon E3, 64GB 1866 Mhz RAM, running OSX v 10.11.3 (El Capitan

@floswald
floswald / #Prob_View.txt
Created September 8, 2018 20:25 — forked from calpolystat/#Prob_View.txt
Probability Distribution Viewer: Shiny app at http://www.statistics.calpoly.edu/shiny
Probability Distribution Viewer Shiny App
Base R code created by Irvin Alcaraz
Shiny app files created by Irvin Alcaraz
Cal Poly Statistics Dept Shiny Series
http://statistics.calpoly.edu/shiny
@floswald
floswald / remarkjs.css
Created August 23, 2018 14:23 — forked from fladd/remarkjs.css
CSS of the example slides on http://remarkjs.com
@import url(https://fonts.googleapis.com/css?family=Droid+Serif);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body {
font-family: 'Droid Serif';
}
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: 400;
# context: http://stackoverflow.com/questions/39448808/julia-tcp-server-and-connection
# Use fn to process messages from sock.
# Loop till sock is open and fn returns true.
function processor(fn, sock)
proc = true
try
while proc && ((nb_available(sock) > 0) || isopen(sock))
proc = fn(sock)
end
@floswald
floswald / Plot_Examples.md
Created March 8, 2016 14:54 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
echo "starting qsub script file"
source ~/.bash_profile
date
module load sge/2011.11
# here's the SGE directives
# ------------------------------------------
@floswald
floswald / googleVis_at_RSS_2012.Rmd
Created September 11, 2012 08:02 — forked from mages/googleVis_at_RSS_2012.Rmd
googleVis at RSS 2012
Creating interactive web graphs with R: Overview and googleVis tutorial
========================================
```{r results='asis', echo=FALSE, message=FALSE, tidy=FALSE}
library(googleVis)
df <- data.frame(Postcode=c("TF3 4JH", "EC1Y 8LX"),
Tip=c("Telford", "RSS"))
## Tree map
T <- gvisTreeMap(Regions, "Region", "Parent", "Val", "Fac",
options=list(width=250, height=150,