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
#!/bin/sh | |
for x in `find . | grep -v .git | grep -v node_modules | grep -v '~' | grep -v package-lock.json | grep -v package.json | grep -v png | grep -v ico | grep -v "backend/db.sqlite" | grep -v .mp3 | grep -v .ogg | grep -v uploads | grep -v .db | grep -v .svg | grep -v log.txt` | |
do | |
echo "<code filename=\"$x\">" | |
cat $x | |
echo "</code>" | |
done | pbcopy |
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
labour_output_gap = function() | |
{ | |
if ( exists("UNRATE") == FALSE ) { fred("UNRATE", environment()) } | |
if ( exists("NROU") == FALSE ) { fred("NROU", environment()) } | |
a = na.trim(na.locf(merge(UNRATE, NROU))) | |
a = a[endpoints(a)] | |
return(UNRATE - NROU) | |
} |
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
multiplot = function(r, legend.loc="topleft", legend.cex=1, overplot=F, plotSecondAxis=F, s_lty=1, plotfunc=recplot, legend=T, pointMax=F, pointLast=F, legendLast=F, legendLastRoundDigits=0 ) | |
{ | |
r = na.omit(r) | |
for ( x in names(r) ) | |
{ | |
n = r[,x] | |
m = n | |
r[,x] = m | |
} |
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
library(quantmod) | |
recplot = function(var, maintitle="", ylab="", ylim=NULL) | |
{ | |
if ( exists("USRECD") == FALSE ) { getSymbols("USRECD", src="FRED", env=.GlobalEnv) } | |
a = na.locf(cbind(USRECD, var)) | |
a = a[ .index(a) %in% .index(var) ] | |
par(oma=c(0,0,0,0)) | |
par(xaxt="n", yaxt="n") |
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
/* | |
* This is a multi-select dropdown combobox deriviative! | |
* | |
* I had seen that some other folks had been looking for similar functionality, and although the Qooxdoo | |
* community was helpful, and explained what kinds of things they'd have to do to implement it, no finished class | |
* emerged. So, I had the need, and here it is. Please spin any improvements back to me! | |
* | |
* Matthew Busigin, CIO @ Hover Networks, Inc (mbusigin <at> hovernetworks <dot> com) | |
* | |
* We're overriding a bunch of stuff here: |
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
library(quantmod) | |
getSymbols(c("GDP", "CMDEBT"), src="FRED") | |
plot(cumsum(na.omit(diff(GDP) - diff(CMDEBT)))) |
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
## | |
## Unfortunately, FRED no longer will be providing a whole bunch of interest rate series, principally Moody's. | |
## I use the Baa spread as the bedrock of my analysis, and although I can get a colleague to export the data from a BB terminal, | |
## I really needed to create a proxy so I can get data more quickly than that. | |
## | |
## The idea here is to impute the Baa spread from market inputs that we still have access to: 10s30s (because Baa spread has a | |
## duration spread embedded in it), the IEF/LQD ratio, and inverted 10s, in order to correct for convexity. | |
## | |
## The result is pretty decent: from 1986-2016, we get an R^2 of 0.9, RMSE of 0.26. I'm sure it could be improved upon, so let me know | |
## if you have any other ideas. |
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
llxc = function( a, ll=-12:12, legend.loc="topleft", displayLegend=T, legend.cex=1.0, overplot=F ) | |
{ | |
if ( ncol(a) < 2 ) | |
{ | |
print( "Not enough columns") | |
return; | |
} | |
a = na.omit(a) | |
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
#!/usr/bin/perl -W | |
# From populationpyramid.net's data source https://github.com/madewulf/PopulationPyramid.net/tree/master/static/data/generated | |
# Takes the JSON as stdin, returns a CSV with the M/O ratio | |
use strict; | |
use JSON; | |
use Data::Dumper; | |
my $json = JSON->new; |
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
function() | |
{ | |
if ( exists("CPIAUCSL") == FALSE ) { fred("CPIAUCSL", environment()) } | |
if ( exists("MCOILWTICO") == FALSE ) { fred("MCOILWTICO", environment()) } | |
if ( exists("CUSR0000SEHC") == FALSE ) { fred("CUSR0000SEHC", environment()) } | |
recplot( (MCOILWTICO/CPIAUCSL)*-1.5736 + Delt(CUSR0000SEHC, k=12*5)* 6.5426 + 1.5954 ) | |
lines( cagr(dlag(CPIAUCSL, k=12*5), 5), col="dodgerblue3" ) | |
} |
NewerOlder