This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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" ) | |
} |
This file contains hidden or 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 hidden or 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
## | |
## The quantmod function, getSymbols.FRED(), has been broken by the recent upgrade to FRED to https only. | |
## I've taken that function and tweaked it to work. | |
## | |
fred <- function (Symbols, env, return.class = "xts", ...) | |
{ | |
importDefaults("getSymbols.FRED") | |
this.env <- environment() | |
for (var in names(list(...))) { | |
assign(var, list(...)[[var]], this.env) |
This file contains hidden or 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
plotNeoclassicalGrowth = function() | |
{ | |
if ( exists("GDP") == FALSE ) { getSymbols("GDP", src="FRED") } | |
if ( exists("GDPC96") == FALSE ) { getSymbols("GDPC96", src="FRED") } | |
if ( exists("CLF16OV") == FALSE ) { getSymbols("CLF16OV", src="FRED") } | |
if ( exists("GPDI") == FALSE ) { getSymbols("GPDI", src="FRED") } | |
if ( exists("COFC") == FALSE ) { getSymbols("COFC", src="FRED") } | |
a = na.omit(merge(Delt(CLF16OV, k=12), (GPDI-COFC)/GDP, Delt(GDPC96, k=4) - Delt(CLF16OV, k=12) - ((GPDI-COFC)/CPIAUCSL)/GDP)) * 100 | |
z = a |
This file contains hidden or 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
getSymbols("^GSPC", from="1950-01-01") | |
p = 10 | |
a = na.omit(merge( volatility(GSPC, n=p)*100, lag(volatility(GSPC, n=p), k=-p)*100 )) | |
names(a) = c("hv", "rv") | |
medianvalues = c() | |
meanvalues = c() | |
maxvalues = c() | |
minvalues = c() | |
keys = c() | |
for ( x in seq( 0, max(a$hv), 2 ) ) |
NewerOlder