Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjpcjp/9a1ca9c46bbc37217af7 to your computer and use it in GitHub Desktop.
Save bjpcjp/9a1ca9c46bbc37217af7 to your computer and use it in GitHub Desktop.
CausalImpact using R
# source: http://multithreaded.stitchfix.com/blog/2016/01/13/market-watch/
# https://github.com/klarsen1/MarketMatching
# from terminal command line:
sudo apt-get install libcurl4-openssl-dev
# from R command line:
# install CausalImpact package:
install.packages("devtools")
library(devtools)
devtools::install_github("google/CausalImpact")
library(CausalImpact)
# install dtw package:
install.packages("dtw")
# install MarketMatching package
library(devtools)
install_github("google/CausalImpact")
install_github("klarsen1/MarketMatching", build_vignettes=TRUE)
# two key techniques needed to do intervention analysis: dynamic time warping and Bayesian structural time series models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment