Skip to content

Instantly share code, notes, and snippets.

View maxbiostat's full-sized avatar

Luiz Max Carvalho maxbiostat

View GitHub Profile
library(deSolve)
sir <- function(time, state, parameters) { ## this is the ODE system
with(as.list(c(state, parameters)), {
dS <- -beta * S * I
dI <- beta * S * I - gamma * I
dR <- gamma * I
return(list(c(dS, dI, dR)))
})
}
@maxbiostat
maxbiostat / zeta_woes.md
Last active February 6, 2019 13:02
Implementing zeta function in Stan

Stan model

functions{
    real zeta(real s);
    /*TODO: implement rng for prior and posterior predictive checks*/
}
data{
  int<lower=0> K; // number of unique values
  int values[K];
  int<lower=0> frequencies[K];