This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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,] |