Skip to content

Aggvars in ptype parameters#70

Open
MichaelTiemann wants to merge 78 commits intovfitoolkit:masterfrom
MichaelTiemann:aggvars_in_ptype_parameters
Open

Aggvars in ptype parameters#70
MichaelTiemann wants to merge 78 commits intovfitoolkit:masterfrom
MichaelTiemann:aggvars_in_ptype_parameters

Conversation

@MichaelTiemann
Copy link
Contributor

The change makes AggVars visible to downstream PType structures as they are revealed from upstream computations. A clever user can order their PTypes so that AggVars flow downstream to be used as parameters by later PTypes. This does require pre-loading AggVar parameters used in this way (not much different than pre-loading GE price guesses).

While we're at it, complete the functionality for CustomModelStats, which I was working on at the same time.

robertdkirkby and others added 30 commits January 10, 2026 07:11
This function does VFI with grid interplayer for the case of no d variable using sparse matrix in Howard improvement. Also other changes, see forum.
…-postGI

Added function ValueFnIter_postGI_sparse_nod_raw
The principle change is to bring across the gridvals changes implemented in commit 347366c.

After implementing those changes in `ValueFnIter_FHorz_RiskyAsset_nod1_semiz_raw` and `ValueFnIter_FHorz_RiskyAsset_EpsteinZin_nod1_semiz_raw`, a few incongruities emerged from `StationaryDist_FHorz_RiskyAssetSemiExo` regarding the contents of `refine_d` and/or `l_dsemiz`.  Please check that the new test I've put in is sensible.

Finally, after running this lifecycle test, it reveals the Out-Of-Memory (OOM) errors mentioned in the comments.  Reverting to the commented-out code (which is less aggressive in the use of gpuArray) keeps things within the limits of a 32GB GPU.
I have added ValueFnIter_postGI_sparse_raw to do Howards sparse for the case of d variable.
Moreover, I have improved the existing function ValueFnIter_Refine_postGI_raw using Claude code. The trick was to replace interp1 with matrix multiplication: gives 25% speed-up, quite consistent across versions and computers
Eliminated blank space before V0 as suggested by Michael
robertdkirkby and others added 29 commits February 2, 2026 10:20
This is my best guess at extending the pattern to support 3 other assets and an experience asset.  I have used this code to successfully run a modified OLG14 with an experience asset that produces results I expected.

If this is correct, it should be adapted to the other ExpAsset cases.
Support the noz case as well.
…-n_a-eq-4

Support ExpAsset with length(n_a)==4
Fix a few typos and spell ordinals (1st, 2nd, 3rd, 4th) with proper suffixes.
Howards-greedy does not work with non-finite return values.  Rather than testing whether we get any such and warning, we move the test inside the loop so that errors can be flagged closer to their initial appearance.  This makes understanding and fixing such errors easier when debugging.
…tection_for_nonfinite_retvals

Relocate error message concerning non-finite return values
…s_PType_improvements

Ignored PTypes now listed with proper ordinal suffixes
When evaluating agents in PType structures (such as firms and households), it happens that we can inject just-calculated AggVars into the Parameter lists of to-be evaluated PType structures, increasing the power and generality of using PTypes.

Also update `HeteroAgentStationaryEqm_Case1_PType_subfn` to handle CustomModelStats.
When evaluating agents in PType structures (such as firms and households), it happens that we can inject just-calculated AggVars into the Parameter lists of to-be evaluated PType structures, increasing the power and generality of using PTypes.

Also update `HeteroAgentStationaryEqm_Case1_PType_subfn` to handle CustomModelStats.
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.

3 participants