I hereby claim:
- I am bestdan on github.
- I am dpegan271 (https://keybase.io/dpegan271) on keybase.
- I have a public key ASBCTT8RIBBl4GrD_mXa50Qkb8gxy2XmNULJld4SBNfB2wo
To claim this, I am signing this object:
#!/usr/bin/env sh | |
# # These functions make it easy to look at the output of a dart | |
# # test with large non-matching objects. | |
# | |
# # To use: | |
# # One and done: | |
# auditDartTest test/example_test.dart 'this test fails' | |
# |
#' @title S&P 500 heatmap | |
#' @author Daniel Egan | |
#' @description Creates real and nominal triangle heatmaps based on the S&P 500. | |
#' @details Last update 2012-06-01 | |
### ---- | |
library(quantmod) | |
library(RColorBrewer) | |
#Some useful matrix functions |
#' @title Log-means versus Medians | |
#' @author Daniel Egan | |
#' @description When data has a power law or extremely skewed distribution, | |
#' using a log-mean usually results in more stable and useful central estimates | |
#' compared to a mean or a median. | |
#' https://towardsdatascience.com/on-average-youre-using-the-wrong-average-geometric-harmonic-means-in-data-analysis-2a703e21ea0 | |
library(dplyr) | |
library(tidyr) | |
library(ggplot2) |
library(ggplot2) | |
library(tidyr) | |
library(dplyr) | |
# Normalize | |
data(mtcars) | |
mtcars_norm <- as.data.frame(apply(mtcars, 2, scale)) | |
# Make long |
# Version 1: LOC incentive --> inflated code | |
add_up = function(inputs){ | |
total = inputs[1] | |
for i in 2:length(inputs){ | |
total = total + inputs[i] | |
} | |
return(total) | |
} |
def cs_service_bot(): | |
welcome_message = """Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? | |
\n[1] New Customer | |
\n[2] Existing Customer | |
\n""" | |
response = input(welcome_message) | |
if response == "1": | |
new_customer() |
I hereby claim:
To claim this, I am signing this object:
rm(list=ls()) | |
library(quantmod) | |
library(lubridate) | |
library(PerformanceAnalytics) | |
#' Required 'drawdown' size | |
#' Default: -6% return | |
drawdownHurdle<- -0.06 | |
# Grab data ----------------------------------------------------------------------------------- |
effFrontier = function (data, nports = 20, shorts=T,wmin=0, wmax=1) | |
{ | |
rcov<-cov(data) | |
averet<-colMeans(data) | |
mxret = max((colMeans(data))) | |
mnret = 0#-mxret Long only... | |
n.assets = ncol(data) | |
reshigh = rep(wmax,n.assets) | |
if( shorts ) | |
{ |