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

"n" order > number of exogenous gives an error #120

Open
ezgioz opened this issue Oct 11, 2017 · 3 comments
Open

"n" order > number of exogenous gives an error #120

ezgioz opened this issue Oct 11, 2017 · 3 comments

Comments

@ezgioz
Copy link
Contributor

ezgioz commented Oct 11, 2017

In options section of a yaml file when size of "order" is larger than the size of "exogenous" we get an error like the following:

Check the dimension of the matrix given in the yaml file, section: options-grid-orders. Expected to be of dimension [1, 3]

This should be corrected and updated at src/model.jl at line 165 to 169

     if !(typeof(model.exogenous)<:Union{Dolo.DiscreteMarkovProcess,Dolo.ProductProcess} ) && length(model.calibration[:exogenous])>1 && length(orders)!=length(model.calibration[:exogenous])
         msg = string("Check the dimension of the matrix given in the yaml file, section: options-grid-orders. ",
                     "Expected to be of dimension $([1, length(model.calibration[:exogenous])])")
         error(msg)
    end
@albop
Copy link
Member

albop commented Oct 11, 2017

Thanks @ezgioz . The condition in src/model.jl is indeed incorrect and I fear it breaks many models. It should be simply length(orders)!=length(model.calibration[:endogenous]. Do you want to propose a PR to fix it ? Also, the output in the error message should be [3] not [1,3].

So far, options.grid always refer to the grid of endogenous points. Currently we don't have a way in the yaml file of specifying a specific geometry for the exogenous. This can be done in Julia with the discretize method. Bringing an option to do that in the yaml file (specify discretization options), could indeed be an open issue. Further down in the future, we could also imagine a way of specifying joint grids on exo and endo that are not cartesian products of two grids (where endogenous space would depend on exogenous value), but that is not the priority.

@ezgioz
Copy link
Contributor Author

ezgioz commented Oct 11, 2017

Thanks @albop. I thought that what we were doing was

length(orders)!=length(model.calibration[:states])

Apparently I am mistaken. But the key "endogenous" for "model.calibration" does not exist. Here are the keys:

Dolo.GroupedCalibration with 6 entries:
:values
:controls
:states
:exogenous
:rewards
:parameters

Does the number of endogenous should be equal to sum of states and controls? In that case I could edit as below. What do you suggest?

length(orders)!=length(model.calibration[:states]) + length(model.calibration[:controls])

@albop
Copy link
Member

albop commented Oct 11, 2017

oh no, you're right : it's :states, not :endogenous.

We denote exogenous states as :exogenous and the endogenous states as :states.

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