julia-mpsge / MPSGE.jl

MPSGE for Julia
MIT License
14 stars 2 forks source link

y & u out, if for CD demand, add WiNDC nat test #144

Closed EliLazarus closed 7 months ago

EliLazarus commented 7 months ago

This includes the 2 fixes needed to correctly solve the WiNDC national model, both with the 'original' data, and the secondard Julia-generated WiNDCdata.

1) The y_over_y_bar and u_over_u_bar functions and their inclusion in the compensated demand, supply, and final demand equations (and their sub-expression) were removed. In our construction, those variables, the indexing for those appear in the final equations. 2) The Cobb-Douglas case (demand elasticity==1) in the expenditure expression has a new conditional branch. 1/(1-elasticity) as was being constructed by just using the CES form caused an Inf. Somehow that was getting through until something about the Julia-generate WiNDC data made it evaluate in a different way.

I also add the WiNDC national model with 2 additional demand elasticity value counterfactuals as a test.

EliLazarus commented 7 months ago

The breaking test is (pretty sure) some issue with the JLD2 data files used in the WiNDC national model test. I thought the issue was fixed by down-versioning to limit to JLD2 0.4.44 which had fixed the same error for me locally at some point, but it doesn't seem to fix with that added to the Project.toml, and I then couldn't replicate that bug locally.

The JLD2 has a Dict of DenseAxisArrays, which I didn't manage to transfer to csvs or xlsx.

EliLazarus commented 7 months ago

Suggested fix from JLD2

EliLazarus commented 7 months ago

It's (surely) the PATH license!