diff --git a/dolo/compiler/symbolic.py b/dolo/compiler/symbolic.py index ca758df9..d7ec8c19 100644 --- a/dolo/compiler/symbolic.py +++ b/dolo/compiler/symbolic.py @@ -219,6 +219,8 @@ def eval_scalar(tree): elif isinstance(tree, ast.UnaryOp): if isinstance(tree.op, ast.USub): return -tree.operand.n + if isinstance(tree.op, ast.UAdd): + return tree.operand.n else: raise Exception("Don't know how to do that.") except: diff --git a/dolo/tests/test_rbc.py b/dolo/tests/test_rbc.py index b1c63463..e03f59f5 100644 --- a/dolo/tests/test_rbc.py +++ b/dolo/tests/test_rbc.py @@ -21,9 +21,9 @@ def test_rbc_model(): pol = evaluate_policy(model, dr, verbose=True) polg = evaluate_policy(model, drg, verbose=True) - sim = simulate(model, dr, n_exp=0) # irf - sim = simulate(model, dr, n_exp=2) # stochastic simulations (2 draws) - # extract first simulation + sim = simulate(model, dr, n_exp=0) # irf + sim = simulate(model, dr, n_exp=2) # stochastic simulations (2 draws) + # extract first simulation assert(len(sim[0]['k'])==40)