Skip to content

Instantly share code, notes, and snippets.

# ### Import libraries
using CSV
using DataFrames
using Turing
using Plots
using StatsBase
using StatsFuns: logistic
using MLBase
# ### Prepare data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aronatkins
aronatkins / install-rstudio-daily.sh
Last active February 10, 2022 08:54
Install RStudio daily build on OSX/macOS or Ubuntu Linux
#!/bin/bash
#
# Installs the latest RStudio daily desktop build for OSX/macOS and Ubuntu(amd64)
#
# https://support.rstudio.com/hc/en-us/articles/203842428-Getting-the-newest-RStudio-builds
set -e
install_macos_daily() {
REDIRECT_URL="https://www.rstudio.org/download/latest/daily/desktop/mac/RStudio-latest.dmg"
@xprimexinverse
xprimexinverse / AMECO Example 1.R
Created October 22, 2014 01:35
Accessing European Commission (DG ECFIN) AMECO Database
# --------------------------------------------------------------------------------
# Author: Graeme Walsh Date: 22/10/2014
# Title: "AMECO Example 1.R"
# Description: A script demonstrating how to access data from the AMECO database.
# Note: (to self) revise style and remove some hard coding.
# --------------------------------------------------------------------------------
# For illustrative purposes, let's get Annual Unemployment data for Ireland.
# Shown is how to import the data - in addition to some munging.
@zachmayer
zachmayer / cv.ts.R
Created December 12, 2011 16:26
Time series cross-validation 3
#Function to cross-validate a time series.
cv.ts <- function(x, FUN, tsControl, xreg=NULL, ...) {
#Load required packages
stopifnot(is.ts(x))
stopifnot(is.data.frame(xreg) | is.matrix(xreg) | is.null(xreg))
stopifnot(require(forecast))
stopifnot(require(foreach))
stopifnot(require(plyr))