Skip to content

Instantly share code, notes, and snippets.

View jkeirstead's full-sized avatar

James Keirstead jkeirstead

View GitHub Profile
@jkeirstead
jkeirstead / need-analysis.r
Last active October 13, 2015 03:48
Analysis of DECC NEED data
## Analysis of DECC NEED data
## James Keirstead
## 22 November 2012
##
## Underlying data available from
## http://www.decc.gov.uk/en/content/cms/statistics/energy_stats/en_effic_stats/need/need.aspx
## For more info, see
## http://www.jameskeirstead.ca/blog/we-need-more-data/
@jkeirstead
jkeirstead / gp-regression-demo.r
Created April 5, 2012 16:38
Demo of Gaussian process regression with R
# Demo of Gaussian process regression with R
# James Keirstead
# 5 April 2012
# Chapter 2 of Rasmussen and Williams's book `Gaussian Processes
# for Machine Learning' provides a detailed explanation of the
# math for Gaussian process regression. It doesn't provide
# much in the way of code though. This Gist is a brief demo
# of the basic elements of Gaussian process regression, as
# described on pages 13 to 16.
@jkeirstead
jkeirstead / monte-carlo-sample.r
Created February 3, 2012 14:33
Generate a Monte Carlo sample with Sobol' LDQR sequence
# Generate a Monte Carlo sample using Sobol' low-discrepancy quasi-random sequences
# James Keirstead
# 3 February 2012
#
# Random sampling with R's standard methods is inefficient for Monte Carlo analysis as
# the sampled values do not cover the parameter space evenly. This Gist allows users
# to create parameter samples using Sobol' sequences to get around this problem.
# makeMCSample
# Makes a Monte Carlo sample using Sobol' sequences