forked from rosie068/BARRA_risk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalBarraFactorVal.py
More file actions
45 lines (38 loc) · 1.77 KB
/
Copy pathCalBarraFactorVal.py
File metadata and controls
45 lines (38 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Created on Wed Nov 13 2019
@author: RosemaryHe
"""
import pandas as pd
import numpy as np
from CalBarraLiquidity import CalBarraLiquidity
from CalBarraQuality import CalBarraQuality
from CalBarraValue import CalBarraValue
from CalBarraGrowth import CalBarraGrowth
from CalBarraSentiment import CalBarraSentiment
from CalBarraMomentum import CalBarraMomentum
from CalBarraSize import CalBarraSize
from CalBarraVolatility import CalBarraVolatility
from CalBarraDividendYield import CalBarraDividendYield
from Factor_exposure import Factor_exposure
from Regression import Regression
from Matrices import Matrices
dates = pd.date_range('20140101', '20191231')
CalBarraVolatility(dates) ##tested for first 300 entries
CalBarraLiquidity(dates) ##tested for first 300 entries
CalBarraSize(dates) ##tested for first 300 entries
CalBarraMomentum(dates) ##tested for first 300 entries
CalBarraQuality(dates) ##tested for first 300 entries, some data missing
CalBarraValue(dates) ##tested for first 300 entries, some data missing
CalBarraGrowth(dates) ##tested for all entries of first 2 stocks, some data missing
CalBarraDividendYield(dates) ##not tested, missing all data
CalBarraSentiment(dates) ##not tested, missing all data
Factor_exposure(dates)
##tested for small segment of data, combines all factors into nine major factors and fill in missing data
##may have trouble with running time and some logic on bigger dataset
##fill_in functions NOT tested!
Regression(dates)
##regress to find risk factors' exposures
##tested for sample data, may have trouble with running time on bigger dataset
Matrices()
##estimate covariance matrices F and specific risk Delta, return V, the covariance matrix for stock returns
##tested for sample data, may have trouble with running time on bigger dataset