Skip to content

Instantly share code, notes, and snippets.

View sjvrensburg's full-sized avatar

Stefan Janse van Rensburg sjvrensburg

View GitHub Profile
@sjvrensburg
sjvrensburg / mwe_mcs.R
Last active May 17, 2019 09:05
Model Confidence Set Issue: Minimal Working Example
################################################################
# MODEL CONFIDENCE SET ISSUE: Minimal Working Example #
# #
# Code demonstrating differences between different R functions #
# for calculating Hansen, Lunde and Nason's (2011). #
# #
# Version: 0.2 #
# Date: 17 May 2009 #
################################################################
@sjvrensburg
sjvrensburg / fuel_prices.py
Created July 20, 2021 09:38
A script to scrape the AA's website for historical fuel prices and convert it to a monthly timeseries.
import traces
import pandas as pd
from splinter import Browser
from splinter.exceptions import ElementDoesNotExist
from time import sleep
from datetime import timedelta
def select(browser, coastal=True, fueltype='unleaded_95', year=2008):
"""
@sjvrensburg
sjvrensburg / process_ssrn_pdf.sh
Created July 24, 2024 08:54
Script to process SSRN articles for enlarged printing or viewing on e-reader
#!/bin/bash
# Function to parse arguments
parse_arguments() {
while getopts ":m:" opt; do
case $opt in
m)
margin="$OPTARG"
;;
\?)