-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_arc.py
More file actions
36 lines (28 loc) · 979 Bytes
/
Copy pathrun_arc.py
File metadata and controls
36 lines (28 loc) · 979 Bytes
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
"""Run an abnormal-return event study (ARC) with the bundled sample data.
Usage::
set EST_API_KEY=your-key (Windows)
export EST_API_KEY=your-key (macOS/Linux)
python run_arc.py
"""
import os
from eventstudytools import ARCInput, EventStudyAPI
HERE = os.path.dirname(os.path.abspath(__file__))
api = EventStudyAPI() # reads EST_API_KEY from the environment
params = ARCInput(
benchmark_model="mm", # market model
return_type="log",
non_trading_days="later",
result_file_type="csv",
# test_statistics=[...] # optional; sensible defaults otherwise
)
results = api.run(
params,
files={
"request_file": os.path.join(HERE, "data", "01_RequestFile.csv"),
"firm_data": os.path.join(HERE, "data", "02_FirmData.csv"),
"market_data": os.path.join(HERE, "data", "03_MarketData.csv"),
},
dest_dir=os.path.join(HERE, "results"),
)
for rf in results:
print(f"{rf.name}: {rf.local_path}")