JSON
/////////////////////////
 Step 0: get the data 
 Step 1: find the type: Method 1: {} for dictionary, [] for list
                        Method 2: type(dataJSON)
 Step 2: find the number of items
 Step 3: look at the first one
         For list, use dataJSON[0]
         For dict, use dataJSON['args']
 step 4: go to the next level

import requests
from  pprint import pprint
infile="http://datayyy.com/data_json/data01.json"
a=requests.get(infile).json()
type(a)   # Out[662]: dict
pprint(a,indent=2)

for b in a:print(b)
args
headers
origin
url

/////////////////////////

Which one is the best? CAPM, FF3, FFC4, or FF5
//////////////////////////
Objectives of this term project
    1) understand different models: CAPM, FF3, FF4 and FF5
    2) Understand how download and process data 
    3) Understand the T-value F-values and adjusted R2

a) CAPM: R(IBM) = Rf + beta*(Rm - Rf)                         (1)
            where R(IBM) is the IBM's mean return or expected return 
            Rf is the risk-free rate
            Rm is the market mean return or expected return 

b) FF3 Fama-French 3-factor model:
         R(IBM) = Rf + beta1*(Rm - Rf)+beta2*SMB + beta3*HML  (2)
            where SMB is small minus big, HML is high book-to-market 
            ratio portfolio minus low ratio portfolio 

c) FF4 is the Fama-French-Carhart 4 factor model 
         R(IBM) = ff3 + beta4*MOM                             (3)
            Where MOM is momentum factor
                      
d) FF5 is the Fama-French 5-factor model:
         R(IBM) = ff3  + beta4**RMW + beta5*CMA               (4)
            where RMW is Robust minus weak, CAM is 
               conservative minus Aggressive
  Three questions:
      1)   Which criterion?
      2)   The performance is time-period independent?
      3)   In-sample estimation vs. out sample prediction

   We use the adjusted R2 as our criterion to measure the performance of each model. 
      Step 1: download monthly price data from Yahoo!Finance
      Step 2: choose a period to run various models  
      Step 3: summarize your testing results  (sample statistics)
      Step 4: (Optional: out-of-sample prediction)

source of data: 
       1) CRSP monthly data 
       2) http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html

//////////////////////////