Skip to content

Instantly share code, notes, and snippets.

View othercriteria's full-sized avatar

Daniel Klein othercriteria

View GitHub Profile
@othercriteria
othercriteria / amazon_machine_learning_log.txt
Created April 19, 2015 22:34
Log from Amazon Machine Learning tutorial example fit (2015-04-19)
Message-ID: <Sun Apr 19 22:21:49 UTC 2015_349719896899-pr-ml-XNSJy2LDTht/userlog/349719896899-pr-ml-XNSJy2LDTht>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1024_751099887.1429482109401"
------=_Part_1024_751099887.1429482109401
Amazon Machine Learning
------=_Part_1024_751099887.1429482109401
@othercriteria
othercriteria / hadcrut3_changepoint.R
Created July 6, 2010 20:45
Structural change analysis of HadCRUT3 annual time series data
# Change-point analysis of HadCRUT3 annual time series data
require(strucchange)
# Data import
dat.raw <- read.table("~/Downloads/annual")
dat <- data.frame(temp=ts(dat.raw[,2], start=1850))
dat <- window(cbind(temp=dat$temp, temp_lag1=lag(dat$temp, k = -1)), start=1851, end=2010)
# Structural change model
@othercriteria
othercriteria / ne_climate_2.R
Created July 2, 2010 16:13
New England climate analysis, addressing autocorrelation
# Attempting to replicate analysis in:
# http://wattsupwiththat.com/2010/06/29/waxman-malarkey-impact-zone-us-northeast/
# 7/2/2010: addressing autocorrelation
# Data import and cleanup
# Note that 2010 is excluded due to missing values
dat <- read.table("~/Desktop/drd964x.tmpst.txt", colClasses=c("character",rep("numeric", 12)))
colnames(dat) <- c("id", "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec")
dat$year <- as.numeric(substr(dat$id, 7, 10))
dat <- dat[dat$year < 2010,]