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

ModelError when looking at model's exogenous property #180

Open
sbenthall opened this issue Feb 5, 2020 · 2 comments
Open

ModelError when looking at model's exogenous property #180

sbenthall opened this issue Feb 5, 2020 · 2 comments

Comments

@sbenthall
Copy link
Contributor

When looking at this model:

https://github.com/EconForge/dolo/blob/master/examples/models/consumption_savings.yaml

I get the following error inspecting model.exogenous:

>>> model = yaml_import("../models/consumption_savings.yaml")
>>> model.exogenous

---------------------------------------------------------------------------
ModelError                                Traceback (most recent call last)
<ipython-input-18-26d7372e0ca8> in <module>
----> 1 model.exogenous

~/projects/econ-ark/dolo/dolo/compiler/model.py in exogenous(self)
    310     def exogenous(self):
    311         if self.__exogenous__ is None:
--> 312             self.__exogenous__ = super(self.__class__, self).get_exogenous()
    313         return self.__exogenous__
    314 

~/projects/econ-ark/dolo/dolo/compiler/model.py in get_exogenous(self)
    157         calibration = self.get_calibration()
    158         from dolo.compiler.language import eval_data
--> 159         exogenous = eval_data(exo, calibration)
    160 
    161         from ruamel.yaml.comments import CommentedMap, CommentedSeq

~/projects/econ-ark/dolo/dolo/compiler/language.py in eval_data(data, calibration)
    118             lc = data.lc
    119             msg = f"Line {lc.line}, column {lc.col}.  Tag '{tag.value}' is not recognized.'"
--> 120             raise ModelError(msg)
    121 
    122         if tag.value is not None:

ModelError: Line 29, column 11.  Tag '!AR1' is not recognized.'
@sbenthall
Copy link
Contributor Author

Same error with:
model.get_exogenous()

@albop
Copy link
Member

albop commented Mar 3, 2020

@sbenthall This issue is fixed by 7a12eb7 .
The yaml file is now incorrect and accessing the exogenous property should raise error Line 29, column 11. Unexpected argument 'Sigma'. Expected: 'AR1(ρ=float, σ=float, μ=Optional[float])'
The convention is now that AR1 is a scalar process which accepts scalar arguments, while VAR1
is a vector process, which takes vector or matrices as arguments.
To fix the yaml file either change AR1 by VAR1 or change \Sigma to \sigma as suggested by the error message.

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

2 participants