Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Sedar jonsedar

View GitHub Profile
View MRE_missing_values.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonsedar
jonsedar / mre_issue_gamma_prior_predictive.ipynb
Last active Jan 8, 2020
sample_prior_predictive for a pm.Gamma
View mre_issue_gamma_prior_predictive.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View PoissonRegressionSneezes.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonsedar
jonsedar / DemoPoissonRegression.ipynb
Last active Nov 29, 2020
An excuse to demo Poisson Regression in PyMC3 and PyStan
View DemoPoissonRegression.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View PyMC3ParallelisationIssue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonsedar
jonsedar / insert_coin.r
Last active Dec 16, 2015
Me faffing around with coord_polar(). Stealing / improving (?) Hadley Wickham's help notes (http://docs.ggplot2.org/current/coord_polar.html)
View insert_coin.r
require(ggplot2)
df <- data.frame(
variable = factor(c("Pacman", "Not Pacman"),levels=c("Pacman", "Not Pacman")),
value = c(80, 20)
)
ggplot(df, aes(x="",y=value,fill=variable)) +
geom_bar(width=1,stat="identity") +
scale_fill_manual(values=c("yellow","black")) +
@jonsedar
jonsedar / lib_getter.r
Last active Dec 15, 2015
[R] Convenience function to load R libraries or install then load if they're not found. Handy when deploying/executing new code on several servers. Uses the active boolean response from require() rather than the passive library() load function. Replace the repo with your favorite. This will install libraries to your system's default location.
View lib_getter.r
lib_getter <- function(y){
# Accepts a char array of package / library names, and loads or installs then loads them
# Returns a char array of load status messages
r <- ''
for (x in y) {
if (!require(x,character.only=TRUE,quietly=TRUE,warn.conflicts=FALSE)) {
install.packages(x, repos="http://cran.ma.imperial.ac.uk/")
if(require(x,character.only=TRUE,quietly=TRUE,warn.conflicts=FALSE)) {
r <- c(r,paste(x,'installed and loaded'))
} else {