-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlikelihood_calc.py~
38 lines (26 loc) · 1.23 KB
/
likelihood_calc.py~
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
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 26 14:11:11 2019
@author: Mary Miedema
"""
import time
import likelihood
import logging.config
logger = logging.getLogger(__name__)
# to do: integrate better with top-level run script
def initialize(cfg):
for subject_id in cfg["studySettings"]["subjects"]:
logger.info("Beginning reliability analysis for {}".format(subject_id))
for sim_mode in cfg["studySettings"]["sim_modes"]:
logger.info("Beginning reliability analysis for {}".format(sim_mode))
for t in cfg["reliability_mapping"]["map_times"]:
start = time.time()
# initialize likelihood object
ML_rel = likelihood.ML_reliability(cfg, subject_id, sim_mode, t)
# maximize likelihood with ICM approach
ML_rel.calc_reliability_measures()
# create relevant reliability maps
for map_thresh in cfg["reliability_mapping"]["map_thresholds"]:
ML_rel.map_reliability(map_thresh)
end = time.time()
print(end-start)