Conversation
| print("w = ",w) | ||
| print("b_sp1 = ",b_sp1) | ||
| print("euler_errors = ",euler_errors) | ||
|
|
There was a problem hiding this comment.
I don't think this test will run correctly. I believe it needs an assert statement that will raise an error if the assertion doesn't hold.
There was a problem hiding this comment.
@jtregde Thanks for the comment. Yes, I should have to make the assert statement inside the function. The problem is I don't know what I can compare at this point. I will continue to think of it.
There was a problem hiding this comment.
@JLian401 You could solve the SS in the case that you know the answer of (either by finding it analytically (could be hard!) or by using the solution from a version fo the code you trust - then then you could have an assert statement like:
expected_r = r_ss found in previous run/analytical solution
test_r,w,b_sp1,euler_errors = SS.solve_ss(r_init,params=(beta, sigma, alpha,
A, delta, xi, omega_SS,
imm_rates_SS, S))
assert np.allclose(test_r, expected_r)
| A = 1.0 | ||
| delta = 0.1 | ||
| xi = 0.1 | ||
| S = 80 |
There was a problem hiding this comment.
I would recommend thinking of 3 periods as we did in class so you can compare the results with SS in that
For 3 periods:
'SS interest rate is ', 1.0036834614021983
The only problem that I can think of is the exogenous labor in that model. I am trying to figure out a solution for that.
There was a problem hiding this comment.
That's right - the answer will be different with exogenous labor.
Maybe you could have your scripts (e.g., SS.py) raise an assertion if the SS is not obtained before the maximum iterations are reached. In that way, this test will fail if the SS isn't found and pass if it is.
There was a problem hiding this comment.
@jdebacker Yes. OK. Milton n I are working on that
| print("r = ",r) | ||
| print("w = ",w) | ||
| print("b_sp1 = ",b_sp1) | ||
| print("euler_errors = ",euler_errors) |
There was a problem hiding this comment.
I think there is no need to print
There was a problem hiding this comment.
Sure. The print was only for checking whether SS works in terms of executability. I would like to use the expected_r in Table 8.2 of Chapter 8 and add the assert statement. But I am still struggling on other parts. For example, there is a valueError issue in SS to apply HH module.
|
Jet, here is the work @saharnazb and myself have been working on this morning for test_SS.py. I believe this will perform the iteration assertion that @jtregde and @jdebacker were alluding to. The only problem I encountered with the below script is that my Atom linter was giving me "E999 - SyntaxError: can't assign to operator" on line 24 for |
|
The |
|
The Also, you should get all demographic variables in |
|
Also, you should get all demographic variables in |
|
@jdebacker Yes, He solved the assignment problem with other operators included in there too. 1-mort_rate and both .T. Now it seems he cannot commit them. |
This is an attempt to test SS.py.