Skip to content

Commit

Permalink
add source code to manlike
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- committed Dec 14, 2016
1 parent 768d490 commit 5754bb9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion py/util/optimize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def _build_constraints(model, ignore_problems=False, include_bounds=True):
constraints = constraints + tuple(model.network_based_constraints())
return constraints

def maximize_loglike(model, *arg, ctol=1e-6, options={}, metaoptions=None, two_stage_constraints=False, pre_bhhh=0, cache_data=False, sessionlog=False):
def maximize_loglike(model, *arg, ctol=1e-6, options={}, metaoptions=None, two_stage_constraints=False, pre_bhhh=0, cache_data=False, sessionlog=False, sourcecode=None):
"""
Maximize the log likelihood of the model.
Expand All @@ -263,6 +263,13 @@ def maximize_loglike(model, *arg, ctol=1e-6, options={}, metaoptions=None, two_s
that can enforce these things but perform badly with poor starting points.
"""

if sourcecode is not None:
if isinstance(sourcecode, str):
model.new_xhtml_sourcecode(sourcecode, frame_offset=1)
else:
model.new_xhtml_sourcecode('sourcecode', frame_offset=1)


if sessionlog:
if isinstance(sessionlog, int) and sessionlog>1:
model.session_log(loglevel=sessionlog)
Expand Down

0 comments on commit 5754bb9

Please sign in to comment.