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

make tracked macro variables and history available from the AgentPopulation #36

Open
sbenthall opened this issue Oct 25, 2021 · 6 comments · May be fixed by #101
Open

make tracked macro variables and history available from the AgentPopulation #36

sbenthall opened this issue Oct 25, 2021 · 6 comments · May be fixed by #101
Assignees

Comments

@sbenthall
Copy link
Owner

  • income levels/shocks
  • consumption levels
  • wealth quantities
  • share ratios

question is how to aggregate over the many HARK agents....

Plot these in the notebook output to get a sense of the macro dynamics

@sbenthall
Copy link
Owner Author

pLvl - income level

cNrm - consumption (normalized) , control

Share - share of wealth in risky asset, control

aNrm, mNrm -- state variables

@nicksawhney
Copy link
Collaborator

The variables are now all being tracked using the AgentPopulation.agent_df function. How should these be aggregated across the agents? If by subpopulation type, how can the subpopulation type of an agent be determined from the agent itself?

@sbenthall
Copy link
Owner Author

The method that currently does this for other 'macro' variables is class_stats():

https://github.com/sbenthall/HARK_ABM_INTRO_public/blob/master/HARK/hark_portfolio_agents.py#L169

You can see what it does: it uses the agent's parameters as elements in a dataframe record, then groups the dataframe records by the relevant parameters (CRRA and DiscFac)

I think taking the mean and standard deviation makes sense for aggregation.

@sbenthall
Copy link
Owner Author

This is actually more of a feature for the new Population class as it's about exposing macro agent statistics.

@sbenthall sbenthall removed their assignment Jun 6, 2022
@sbenthall
Copy link
Owner Author

depends on #81 , #85, #113

@sbenthall
Copy link
Owner Author

Hi @alanlujan91 -- tossing this issue your way since it looks like it's really about functionality for the AgentPopulation.

The HARK AgentType can track the variables of its agents and provide them in a history object.

Does the AgentPopulation class support analogous functionality? How could it? If it did, we could pass that through to the simulation output.

@sbenthall sbenthall changed the title instrument macro properties in simulation history make tracked macro variables and history available from the AgentPopulation Nov 21, 2022
@alanlujan91 alanlujan91 linked a pull request Feb 2, 2023 that will close this issue
@sbenthall sbenthall removed this from the v0.4 Lucas SHARK milestone Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants