Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve simulation output #36

Merged
merged 9 commits into from
Oct 4, 2023
Merged

Improve simulation output #36

merged 9 commits into from
Oct 4, 2023

Conversation

timmens
Copy link
Member

@timmens timmens commented Oct 2, 2023

In this PR, we change the simulation output from a list of dicts containing the simulated choices (on dict for each period) , to a data frame with multiindex (periods, initial_states_id) and columns corresponding to choices, states and targets (auxiliary variables that might be of interest).


After this simulation call

    res = simulate_model(
        params,
        vf_arr_list=vf_arr_list,
        initial_states={
            "wealth": jnp.array([1.0, 20, 40, 70]),
        },
        targets=["utility"],
    )

the output will look like this:

Screenshot 2023-10-04 at 10 23 31

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Merging #36 (ff3ac76) into main (7962873) will increase coverage by 0.06%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head ff3ac76 differs from pull request most recent head a1a43e2. Consider uploading reports for the commit a1a43e2 to get more accurate results

@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   98.45%   98.52%   +0.06%     
==========================================
  Files          38       38              
  Lines        1947     1969      +22     
==========================================
+ Hits         1917     1940      +23     
+ Misses         30       29       -1     
Files Coverage Δ
src/lcm/simulate.py 98.48% <100.00%> (+0.28%) ⬆️
tests/test_simulate.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@timmens timmens merged commit 3d3ff7b into main Oct 4, 2023
3 checks passed
@timmens timmens deleted the simulation-output branch October 4, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants