Skip to content

Instantly share code, notes, and snippets.

Mike Birdgeneau mikebirdgeneau

Block or report user

Report or block mikebirdgeneau

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mikebirdgeneau on github.
  • I am mikebirdgeneau (https://keybase.io/mikebirdgeneau) on keybase.
  • I have a public key ASBq5JoSE_gmzc7c_R7AsWNZv4X0nd6hN2-Y1qZDrNai8wo

To claim this, I am signing this object:

@mikebirdgeneau
mikebirdgeneau / mvtbetapert.R
Created Dec 22, 2016
Multivariate Beta Pert Distribution
View mvtbetapert.R
#' Multivariate Beta PERT distributions
#'
#' @description Generates random deviates from correlated (modified) pert distributions.
#' this is performed by remapping correlated normal distributions to the beta pert
#' distributions using quantiles.
#'
#' @param n Number of observations. If length(n) > 1, the length is taken to be the number required.
#' @param min Vector of minima.
#' @param mode Vector of modes.
View Rotation of Arbitrary Spatial Data
library(data.table)
library(sp)
library(ggplot2)
library(broom)
library(gridExtra)
set.seed(1)
# Set-up Dummy Data (for example)
n <-
View 3d_kriging_cgs_cosimulation.R
library(gstat)
library(sp)
library(lattice)
library(data.table)
library(ggplot2)
# Create Data Points (Random)
n <- 50
data3D <- data.frame(x = runif(n), y = runif(n), z = runif(n), v = rnorm(n))
coordinates(data3D) = ~x+y+z
@mikebirdgeneau
mikebirdgeneau / 3d_kriging_cgs.R
Created Sep 20, 2016
3D Kriging with Conditional Gaussian Simulation in R
View 3d_kriging_cgs.R
library(gstat)
library(lattice)
# Create Data Points (Random)
n <- 50
data3D <- data.frame(x = runif(n), y = runif(n), z = runif(n), v = rnorm(n))
coordinates(data3D) = ~x+y+z
# Create empty grid to krige
range1D <- seq(from = 0, to = 1, length = 20)
@mikebirdgeneau
mikebirdgeneau / leapYearBirthday.py
Created Apr 6, 2016
When is your birthday if you're born on Feb 29th of a leap year?
View leapYearBirthday.py
from skyfield.api import load
from scipy import optimize
from datetime import datetime
from dateutil import tz
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def earthPosition(t1):
@mikebirdgeneau
mikebirdgeneau / BirdgeneauBabyPredictor.R
Last active Feb 5, 2016
Prediction of Baby Timing & What days of work I'll likely miss...
View BirdgeneauBabyPredictor.R
library(ggplot2)
library(data.table)
library(gridExtra)
library(zoo)
babyTiming<-function(ExpectedDate="2016/02/29",DateofInterest="2016/02/2015",VacationDuration=14){
DateofInterest<-as.Date(DateofInterest)
ExpectedDate<-as.Date(ExpectedDate)
currentDate<-Sys.Date()
@mikebirdgeneau
mikebirdgeneau / federal_expenditures_science_technology.R
Last active Oct 10, 2015
Federal Spending on Science & Technology
View federal_expenditures_science_technology.R
library(ggplot2)
library(data.table)
library(lubridate)
library(stringr)
options(stringsAsFactors = FALSE)
# Data Source: Statistics Canada (Table 358-163)
#(http://www5.statcan.gc.ca/cansim/a26?lang=eng&retrLang=eng&id=3580163&&pattern=&stByVal=1&p1=1&p2=31&tabMode=dataTable&csid=)
@mikebirdgeneau
mikebirdgeneau / GDP_per_capita_G7.R
Last active Oct 10, 2015
Plot GDP per Capita for G7 countries, normalized to when the Harper government took power
View GDP_per_capita_G7.R
library(ggplot2)
library(data.table)
library(lubridate)
# Source: https://stats.oecd.org/index.aspx?queryid=350
dt.gdp<-data.table(read.csv("~/Downloads/QNA_10102015180610407.csv"))
dt.gdp[,Year:=substr(TIME,1,4),]
dt.gdp[,Qtr:=substr(TIME,7,7),]
dt.gdp[,Month:=as.numeric(Qtr)*3-1,]
View Brewing_Force_Carbonation_Charts
library(ggplot2)
library(data.table)
# Metric Table
dt.forceCarb<-data.table(expand.grid(Pressure_bar=seq(0,2,by=0.1),Temperature_C=seq(0,25,by=1)))
dt.forceCarb[,CO2_gl := (Pressure_bar+1.013)*(2.71828182845904^(-10.73797+(2617.25/(Temperature_C+273.15))))*10,]
dt.forceCarb[,CO2_vol:=CO2_gl/1.96,]
dt.forceCarb[,Carbonation:="Over-Carbonated",]
dt.forceCarb[CO2_vol<4,Carbonation:="Highly Carbonated (Lambics / Wheat Beers)",]
You can’t perform that action at this time.