Skip to content

Commit

Permalink
Added some additional flag options to the Estimation Section
Browse files Browse the repository at this point in the history
  • Loading branch information
SeBecker committed Sep 6, 2018
1 parent ce5e048 commit d7a75a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 8 additions & 1 deletion grmpy/estimate/estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ def estimate(init_file):
rslt = adjust_output(opt_rslt, dict_, opt_rslt['x'], data, rslt_dict)
# Print Output files
print_logfile(dict_, rslt)
write_comparison(dict_, data, rslt)

if 'comparison' in dict_['ESTIMATION'].keys():
if dict_['ESTIMATION']['comparison'] == 0:
pass
else:
write_comparison(dict_, data, rslt)
else:
write_comparison(dict_, data, rslt)

return rslt
8 changes: 7 additions & 1 deletion grmpy/estimate/estimate_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ def print_logfile(init_dict, rslt):
"""The function writes the log file for the estimation process."""
# Adjust output
auxiliary = process_se_log(rslt, init_dict)
with open('est.grmpy.info', 'w') as file_:

if 'output_file' in init_dict['ESTIMATION'].keys():
file_name = init_dict['ESTIMATION']['output_file']
else:
file_name = 'est.grmpy.info'

with open(file_name, 'w') as file_:

for label in ['Optimization Information', 'Criterion Function', 'Economic Parameters']:
header = '\n \n {:<10}\n\n'.format(label)
Expand Down
4 changes: 2 additions & 2 deletions grmpy/read/read_auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def process(list_, dict_, keyword):
dict_[keyword]['types'] += ['nonbinary']

# Type conversion
if name in ['agents', 'seed', 'maxiter', 'disp']:
if name in ['agents', 'seed', 'maxiter', 'disp', 'comparison']:
val = int(val)
elif name in ['source', 'file', 'optimizer', 'start', 'dependent', 'indicator']:
elif name in ['source', 'file', 'optimizer', 'start', 'dependent', 'indicator', 'output_file']:
val = str(val)
elif name in ['direc']:
val = list(val)
Expand Down

0 comments on commit d7a75a4

Please sign in to comment.