Skip to content

Instantly share code, notes, and snippets.

View jdossgollin's full-sized avatar

James Doss-Gollin jdossgollin

View GitHub Profile
@jdossgollin
jdossgollin / GEV-Lognormal.ipynb
Created June 14, 2019 18:14
Do we over-use the GEV Distribution?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdossgollin
jdossgollin / Ellsberg.ipynb
Created January 15, 2019 02:31
My attempt to make sense of the Ellsberg paradox https://en.wikipedia.org/wiki/Ellsberg_paradox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jdossgollin
jdossgollin / Plot-Sequential.ipynb
Created July 25, 2018 16:09
Plot a sequential decisions model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"lastUpload":"2020-10-09T16:17:26.309Z","extensionVersion":"v3.4.3"}
@jdossgollin
jdossgollin / gen_extreme_value.stan
Last active December 27, 2022 13:50
Fit a univariate GEV distribution in stan
/*
Fit a GEV distribution in stan
Code is largely based on previous code by
Cameron Bracken: http://bechtel.colorado.edu/~bracken/tutorials/stan/
and Yenan Wu: http://discourse.mc-stan.org/t/troubles-in-rejecting-initial-value/1827
*/
functions{
real gev_lpdf(vector y, real mu, real sigma, real xi) {
vector[rows(y)] z;
vector[rows(y)] lp;
@jdossgollin
jdossgollin / READ_GHCN_dly.R
Created May 19, 2017 15:15
A function to read daily rainfall data from the GHCN data set available at http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/all/
READ_GHCN_dly <- function(filename){
require(data.table)
require(readr)
require(magrittr)
require(stringr)
require(lubridate)
# filename implies that the location of the file is already known
# if not, use the station ID to get the filename:
# filename <- paste0('http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/all/', stn, '.dly')
@jdossgollin
jdossgollin / SeaIceExtent.Rmd
Last active March 31, 2017 12:23
Visualize the extent of sea ice over time. Based on 2010 script by Rasmus E. Benestad. Reference for data: Fetterer, F., K. Knowles, W. Meier, and M. Savoie. 2002, updated 2009. Sea Ice Index. Boulder, CO: National Snow and Ice Data Center. Digital media. http://nsidc.org/data/g02135.html
---
title: "Sea Ice"
output:
html_document: default
html_notebook: default
---
First load up any relevant packages.
This script uses the `pacman` package to make sure any required packages are ready to go -- it's a nice tool.