First you have to make sure you have the java JDK installed.
In a terminal (ubuntu) do this.
sudo apt-get install default-jdk
Then in RStudio you have to install rJava
and RJDBC
install.packages("rJava")
install.packages("RJDBC")
First you have to make sure you have the java JDK installed.
In a terminal (ubuntu) do this.
sudo apt-get install default-jdk
Then in RStudio you have to install rJava
and RJDBC
install.packages("rJava")
install.packages("RJDBC")
import math | |
import numpy | |
import numpy.random as nrand | |
""" | |
Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to | |
discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive. | |
""" | |
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import cvxopt as opt | |
from cvxopt import blas, solvers | |
import pandas as pd | |
import pandas.io.data as web | |
import datetime | |
# Turn off progress printing |
# basic factor analysis | |
# http://blog.alphaarchitect.com/2015/05/28/basic-factor-analysis-simple-tools-to-understand-what-drives-performance/ | |
import pandas as pd | |
import pandas.io.data as web | |
import datetime, re, copy | |
import numpy as np | |
import statsmodels.formula.api as sm | |
start = datetime.date(2000,1,1) |
#!/usr/bin/env python | |
import dateutil | |
from datetime import date, datetime | |
import numpy as np | |
import pandas as pd | |
import requests | |
class YahooException(Exception): |
#!/bin/sh | |
mkdir ~/down/ | |
cd ~/down/ | |
sudo apt-get install build-essential | |
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz | |
tar -xzf Python-2.7.2.tgz | |
cd Python-2.7.2 | |
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev | |
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev | |
sudo apt-get install libssl-dev libdb-dev |
#make sure llvm-3.3 is installed! + numba requirements | |
sudo apt-get install llvm cython python-pip llvm-3.3 | |
sudo LLVM_CONFIG_PATH=/usr/lib/llvm-3.3/bin/llvm-config pip install llvmpy | |
sudo pip install numba |