def _display_expression(self, keys, user_substitutes={}):
<EOL>sigma, alpha, nu, omega, l, variance = sym.var('<STR_LIT>')<EOL>substitutes = {'<STR_LIT>': sigma, '<STR_LIT>': alpha, '<STR_LIT>': l, '<STR_LIT>': variance}<EOL>substitutes.update(user_substitutes)<EOL>function_substitutes = {normcdfln : lambda arg : sym.log(normcdf(arg)),<EOL>logisticln : lambda arg : -sym.log(<NUM_LIT:1>+sym.exp(-arg)),<EOL>logistic : lambda arg : <NUM_LIT:1>/(<NUM_LIT:1>+sym.exp(-arg)),<EOL>erfcx : lambda arg : erfc(arg)/sym.exp(arg*arg),<EOL>gammaln : lambda arg : sym.log(sym.gamma(arg))}<EOL>expr = getFromDict(self.expressions, keys)<EOL>for var_name, sub in self.variable_sort(self.expressions['<STR_LIT>'], reverse=True):<EOL><INDENT>for var in self.variables['<STR_LIT>']:<EOL><INDENT>if var_name == var.name:<EOL><INDENT>expr = expr.subs(var, sub)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>for var_name, sub in self.variable_sort(self.expressions['<STR_LIT>'], reverse=True):<EOL><INDENT>for var in self.variables['<STR_LIT>']:<EOL><INDENT>if var_name == var.name:<EOL><INDENT>expr = expr.subs(var, sub)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>for var_name, sub in self.variable_sort(substitutes, reverse=True):<EOL><INDENT>for var in self.variables['<STR_LIT>']:<EOL><INDENT>if var_name == var.name:<EOL><INDENT>expr = expr.subs(var, sub)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>for m, r in function_substitutes.items():<EOL><INDENT>expr = expr.replace(m, r)<EOL><DEDENT>return expr.simplify()<EOL>
Helper function for human friendly display of the symbolic components.