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

In error: "AssertionError: LivPrb is not a list or time varying distribution" #1305

Open
sbenthall opened this issue Jul 18, 2023 · 7 comments
Assignees

Comments

@sbenthall
Copy link
Contributor

parameters = {'cycles': 0,
 'aNrmInitStd': 0.0,
 'aNrmInitMean': 6,
 'LivPrb': 0.9949620563926881,
 'PermGroFac': 1.0,
 'pLvlInitMean': 0.0,
 'pLvlInitStd': 0.0,
 'Rfree': 1.0,
 'TranShkStd': [0],
 'PermShkStd': [0],
 'CRRA': 3,
 'DiscFac': 0.99,
 'ex_post': None,
 'AgentCount': 1,
 'num_per_type': 1000,
 'RiskyAvg': 1.0916031021270372,
 'RiskyStd': 0.09296520824951145,
 'T_sim': 3000,
 'UnempPrb': 1.0,
 'IncUnemp': 0.0}

a1 = SequentialPortfolioConsumerType(**parameters)

a1.solve()

Gets me this error:

AssertionError: LivPrb is not a list or time varying distribution, but should be because it is in time_vary

This doesn't seem right.

@mnwhite
Copy link
Contributor

mnwhite commented Jul 18, 2023 via email

@alanlujan91
Copy link
Member

In the new Parameters dictionary, If LivPrb is a float it should be recognized as time invariant, if it's a list it should be length T_cycle and recognized as time varying.

@sbenthall
Copy link
Contributor Author

sbenthall commented Jul 19, 2023 via email

@Mv77
Copy link
Contributor

Mv77 commented Jul 19, 2023

The same happens with transhkstd and permshkstd I think?

@alanlujan91
Copy link
Member

It's not a lifecycle model, but LivPrb is a "lifecycle" attribute, so, it needs to be generated as LivPrb = [ 0.9949620563926881 ] because it's an infinitely repeated "lifecycle" of length one.

@sbenthall
Copy link
Contributor Author

Ok. I'm following now.

It sounds like this is something that's hard-coded in the model which probably ideally is not hard-coded in the model, since we run into cases all the time where we want something that wasn't originally thought of as time-varying to be time-varying, etc.

I suppose #1240 is the fix for this.

Looking forward to that PR!

@mnwhite
Copy link
Contributor

mnwhite commented Jul 19, 2023 via email

@Mv77 Mv77 mentioned this issue Jul 24, 2023
3 tasks
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

No branches or pull requests

4 participants