library(BayesianFirstAid)
debugonce(bayes.t.test) # turns off debugging for function after first run
bayes.t.test(co2)
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
#### VPIN calculation ######################################################### | |
#install.packages('fasttime',repos='http://www.rforge.net/') | |
require(data.table); require(fasttime); require(plyr) | |
# Assuming TAQ data is arranged in 1 year stock csv files | |
stock=fread('/TAQ_data.csv'); stock=stock[,1:3,with=FALSE] | |
setnames(stock,colnames(stock),c('DateTime','Price','Volume')); | |
stock[,DateTime:=paste(paste(substr(DateTime,1,4),substr(DateTime,5,6), | |
substr(DateTime,7,8),sep='-'),substr(DateTime,10,17))] | |
setkey(stock,DateTime); | |
stock=as.xts(stock[,2:3,with=FALSE],unique=FALSE, |
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
require(quantmod) | |
require(ggplot2) | |
require(reshape2) | |
require(plyr) | |
require(scales) | |
# Download some Data, e.g. the CBOE VIX | |
getSymbols("^VIX",src="yahoo") | |
# Make a dataframe |
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
library(ggplot2) | |
library(dplyr) # easier data wrangling | |
library(viridis) # colour blind friendly palette, works in B&W also | |
library(Interpol.T) # will generate a large dataset on initial load | |
library(lubridate) # for easy date manipulation | |
library(ggExtra) # because remembering ggplot theme options is beyond me | |
library(tidyr) | |
data<- data(Trentino_hourly_T,package = "Interpol.T") |
NewerOlder