Skip to content

Instantly share code, notes, and snippets.

View twolodzko's full-sized avatar

Timothy Wolodzko twolodzko

View GitHub Profile
@twolodzko
twolodzko / logistic-growth-curve.R
Created August 5, 2017 19:14
example of logistic growth curve
# use RStudio
library(manipulate)
lgrowth <- function(x, a, b, c) a/(1+exp(-(b+c*x)))
manipulate(
curve(lgrowth(x, a, b, c), -4, 4, ylim = c(-1, 2)),
a = slider(-2, 2, initial = 1, step = 0.01),
b = slider(-2, 2, initial = 0, step = 0.01),
@twolodzko
twolodzko / distrtoy.R
Created July 11, 2017 08:14
Interactive visualizations for common distributions in RStudio
library(manipulate)
# Beta
x <- seq(0, 1, by=0.01)
manipulate(
{ ci <- qbeta(c(0.05, .5, 0.95), alpha, beta)
plot(x, dbeta(x, alpha, beta),
col="blue", lwd=2, type="l", las=1, bty="n",