OpenSourceEconomics / grmpy

Python package for the simulation and estimation of generalized Roy model
http://grmpy.readthedocs.io
MIT License
19 stars 5 forks source link

breakdown of typical simulation-estimation workflow #112

Closed peisenha closed 6 years ago

peisenha commented 6 years ago

Please write an integration test to ensure this behaviors does not pop up again. Probably easily integrated in exiting test ...

This command (init attached):

grmpy.simulate('mc_explorations_1.grmpy.ini') rslt = grmpy.estimate('mc_explorations_1.grmpy.ini')

results in this error message


ValueError Traceback (most recent call last)

in () 1 grmpy.simulate('mc_explorations_1.grmpy.ini') ----> 2 rslt = grmpy.estimate('mc_explorations_1.grmpy.ini') 3 print(rslt) ~/ownCloud/office/workspace/software/repositories/organizations/grmToolbox/grmpy/grmpy/estimate/estimate.py in estimate(init_file) 50 # Print Output files 51 print_logfile(dict_, rslt) ---> 52 write_descriptives(dict_, data, rslt) 53 54 return rslt ~/ownCloud/office/workspace/software/repositories/organizations/grmToolbox/grmpy/grmpy/estimate/estimate_auxiliary.py in write_descriptives(init_dict, df1, rslt) 301 estimated sample. 302 """ --> 303 df3, df2 = simulate_estimation(init_dict, rslt, df1, True) 304 with open('descriptives.grmpy.txt', 'w') as file_: 305 # First we note some basic information ab out the dataset. ~/ownCloud/office/workspace/software/repositories/organizations/grmToolbox/grmpy/grmpy/estimate/estimate_auxiliary.py in simulate_estimation(init_dict, rslt, data_frame, start) 255 256 # Simulate endogeneous variables --> 257 Y, D, Y_1, Y_0 = simulate_outcomes(dict_, X, Z, U) 258 259 df = write_output_estimation(Y, D, X, Z, Y_1, Y_0) ~/ownCloud/office/workspace/software/repositories/organizations/grmToolbox/grmpy/grmpy/simulate/simulate_auxiliary.py in simulate_outcomes(init_dict, X, Z, U) 55 56 # Calculate potential outcomes and costs ---> 57 Y_1 = np.dot(coeffs_treated, X.T) + U[:, 1] 58 Y_0 = np.dot(coeffs_untreated, X.T) + U[:, 0] 59 C = np.dot(coeffs_cost, Z.T) + U[:, 2] ValueError: operands could not be broadcast together with shapes (1000,) (100,)

It probably has something to do with the fact that I am requesting an estimation and simulation with a different number of individuals? Please fix. mc_explorations_1.grmpy.txt

SeBecker commented 6 years ago

I fixed this by adjusting the order of the elements that are simulated during the estimation simulation. Additionally I implemented a same_size flag to the random init file generator.

peisenha commented 6 years ago

Thanks, let us collect a couple of issues and then let us merge into master in our 1:1 on Thursday.

On Thu, Jan 25, 2018 at 11:15 AM, Sebastian Becker <notifications@github.com

wrote:

I fixed this by adjusting the order of the elements that are simulated during the estimation simulation. Additionally I implemented a same_size flag to the random init file generator.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/grmToolbox/grmpy/issues/112#issuecomment-360422372, or mute the thread https://github.com/notifications/unsubscribe-auth/ADcMJy_Njw2GOFCz5Tk0OF7qMwdDhk-Yks5tOFQ4gaJpZM4RpTkz .

-- Philipp Eisenhauer Economist

Mail eisenhauer@policy-lab.org Web www.eisenhauer.io Repository https://github.com/peisenha

peisenha commented 6 years ago

Please use the sebecker_bugfixes project and put the cards to the done column that you addressed. Then we can easily close a bunch of issues on Thu.

On Thu, Jan 25, 2018 at 3:03 PM, Philipp Eisenhauer < eisenhauer@policy-lab.org> wrote:

Thanks, let us collect a couple of issues and then let us merge into master in our 1:1 on Thursday.

On Thu, Jan 25, 2018 at 11:15 AM, Sebastian Becker < notifications@github.com> wrote:

I fixed this by adjusting the order of the elements that are simulated during the estimation simulation. Additionally I implemented a same_size flag to the random init file generator.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/grmToolbox/grmpy/issues/112#issuecomment-360422372, or mute the thread https://github.com/notifications/unsubscribe-auth/ADcMJy_Njw2GOFCz5Tk0OF7qMwdDhk-Yks5tOFQ4gaJpZM4RpTkz .

-- Philipp Eisenhauer Economist

Mail eisenhauer@policy-lab.org Web www.eisenhauer.io Repository https://github.com/peisenha

-- Philipp Eisenhauer Economist

Mail eisenhauer@policy-lab.org Web www.eisenhauer.io Repository https://github.com/peisenha