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
# * Fri Feb 24 2012 09:09:10 PM Steven E. Pav <shabbychef@gmail.com> | |
# | |
# computation of moments and moment-based statistics | |
# | |
# see also: | |
# * http://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/ | |
# * http://www.johndcook.com/standard_deviation.html | |
# * J. Bennett, et. al., 'Numerically Stable, Single-Pass, | |
# Parallel Statistics Algorithms,' Proceedings of IEEE | |
# International Conference on Cluster Computing, 2009. |
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
require(quantmod) | |
getSymbols(c("SPY","TLT","GLD","AAPL")) | |
allofem <- merge(SPY[,"SPY.Adjusted"],TLT[,"TLT.Adjusted"],GLD[,"GLD.Adjusted"],AAPL[,"AAPL.Adjusted"]) | |
mo.pry <- to.monthly(allofem,OHLC=FALSE) | |
mo.ret <- diff(log(mo.pry)) | |
sub.ret <- mo.ret[(dim(mo.ret)[1]-59):dim(mo.ret)[1],] | |
mu <- apply(sub.ret,2,mean,na.rm=TRUE) | |
Sg <- cov(sub.ret,use="complete.obs") | |
w <- solve(Sg,mu) | |
n <- dim(sub.ret)[1] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 12 columns, instead of 2. in line 8.
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
Entity Name Title Base Overtime Other (vacation, sick, bonus, etc) Medical/Dental/Visual Employeer Contribution to Pension Employee Contribution to Pension Paid By Employer Employer Contribution to Deferred Compensation (401k) Misc Total Cost of Employment | |
Bay Area Rapid Transit Dugger, Dorothy General Mgr 298700 0 34500 14951 39521 23324 1869 6796 419661 | |
Bay Area Rapid Transit Crunican, Grace General Mgr 312461 0 3846 19141 37513 17500 1869 7591 399921 | |
Bay Area Rapid Transit Tietz, Forrest Police Sergeant 136746 111902 33921 18200 60630 156 0 1107 362662 | |
Bay Area Rapid Transit Pangilinan, Edgardo Asst Controller 107785 0 214322 10903 13017 7650 1869 5734 361279 | |
Bay Area Rapid Transit Lucarelli, Frank Police Lieutenant 173811 46280 33422 23364 76427 233 0 5019 358556 | |
Bay Area Rapid Transit Collier, Roberta Asst Treasurer 33971 0 289534 1797 4072 2378 1869 4897 338518 | |
Bay Area Rapid Transit Parker, Thomas Exec Mgr Transit System Compl 136544 0 145633 19139 16863 9923 1869 5584 335554 | |
Bay Area Rapid Transit Rai |
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
# see | |
# http://climateecology.wordpress.com/2013/08/19/r-vs-python-speed-comparison-for-bootstrapping/ | |
# first version#FOLDUP | |
set.seed(101) | |
# generate data | |
x <- 0:100 | |
y <- 2*x + rnorm(101, 0, 10) | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
" code to place in .vimrc to make Conque play nicely with R | |
" (or other languages, though you would have to generalize the | |
" commands to allow different syntax and filetypes) | |
" | |
" to use, place in .vimrc, resource, and issue | |
" | |
" :RConque | |
" | |
" this will give you a screen session named 'r'; | |
" use R in this session; |
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/bash -e | |
# | |
# Created: 2016.02.05 | |
# Copyright: Steven E. Pav, 2016 | |
# Author: Steven E. Pav | |
# Comments: Steven E. Pav | |
function finish() { | |
echo doing cleanup 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
# Created: 2015.05.18 | |
# Copyright: Steven E. Pav, 2015 | |
# Author: Steven E. Pav <shabbychef@gmail.com> | |
# Comments: Steven E. Pav | |
library(shiny) | |
library(ggplot2) | |
library(reshape2) | |
library(hypergeo) |
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(Rcpp) | |
source('yunoparallel.cpp') | |
x <- rnorm(1e5) | |
dumbCount_int(x) | |
dumbCount_int(x) | |
# seems fine, except ... | |
replicate(10,dumbCount_int(x)) | |
sd(replicate(100,dumbCount_int(x))) |