Skip to content

Instantly share code, notes, and snippets.

View stablemarkets's full-sized avatar
:octocat:
Still sampling

Arman Oganisian stablemarkets

:octocat:
Still sampling
View GitHub Profile
@stablemarkets
stablemarkets / corr_mod.stan
Last active April 27, 2020 16:59
Smoothed logistic growth with time-varying carrying capacity.
data {
int<lower=0> num_obs; // number of observations
real y[num_obs]; // Observed value
int time[num_obs]; // time
}
parameters {
//weakly uninformative priors, K on log base 10 scale
vector[100] log_K;
real<lower=0,upper=100> p0;
# full code at
# https://github.com/stablemarkets/BayesianTutorials/blob/master/MH_with_caching/
# Author: Arman Oganisian
library(microbenchmark)
library(LaplacesDemon)
library(MASS)
source("HelperFunctions.R") # contains mh_vanilla and mh_cache
set.seed(10)