You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Hi, I am a researcher that is currently trying to use the FRBNY DSGE Model for my country. I read in the NEWS.md doc that "Model1002" update, considers now the impact of the COVID-19 pandemic. I am new in Julia. Can you please tell me the code to run "Model1002" that considers COVID-19?
Regards,
Fabrizio Ardiles
The reason will be displayed to describe this comment to others. Learn more.
Hi Fabrizio,
Since you're new in Julia, you should definitely first familiarize yourself with Julia (the QuantEcon tutorials are very good). After that, you should read the DSGE documentation. As you read through the documentation, it may be helpful to also run some of the code in the example scripts provided.
For the adjustments to Model1002, you will need to dev the DSGE package since the adjustments are not yet part of an official release (this should be coming in the next week or so). Please see subspecs ss59-ss61 of Model1002 in src/models/representative/m1002/subspecs.jl. To get a better idea of how these subspecs are used, I'd recommend reading our recent blog about it.
Note that not all the features available for "standard" DSGE models in the package are available for the adjusted Model1002. Estimating the model, for example, is probably not going to work straight out of the box, and running full-distribution forecasts will require a bit of familiarity with the model. However, running modal exercises with the model should be straightforward.
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your answer William,
I've already read the QuantEcon tutorials. Somehow, I'm not being able to see the DSGE documentation with codes in the example scripts provided (just read the DSGE documentation that describes theoretically the model). Can you please send me the doc or the link?.
The reason will be displayed to describe this comment to others. Learn more.
See here for old releases. I’d recommend downloading the newest release (1.42). While the DSGE v1.5 requires 1.1 or 1.0, future releases will work in all Julia 1.x versions.
The reason will be displayed to describe this comment to others. Learn more.
Dear Chen,
Thank you so much for the provided documentation. Here is my current situation:
1. I´ve already update Julia's Version as well as DSGE´s Version Package. Fortunately, the file (run_default.jl) succeed!. What I am not so sure, is where I can see the results extracted from the solution of the DSGE model.
2. I am trying to replicate the plots provided in your recent blog [(https://libertystreeteconomics.newyorkfed.org/2020/06/the-new-york-fed-dsge-model-forecastjune-2020.html)]. Can you please tell me what is the code, so I can get that exact provided plots in your recent blog, and thus adapt the results with data for my country.
3 Finally, I am trying to change the data for the DSGE Model, but I am not so sure how to do it. Do you know how to do it?
The reason will be displayed to describe this comment to others. Learn more.
Please see the make_packet.jl code for relatively automated generation of plots.
Unfortunately, the code for those precise plots are not part of the package and do involve some non-Julia formatting. However, you can replicate the exact lines/bands by using the plotting functionality in the package, namely plot_history_and_forecast. Please see the docstring for it in Julia REPL and it may be worthwhile to actually read the underlying code (see the src/plots folder). You will want to produce the :forecast4qobs, :forecast4qpseudo, :hist4qobs, :hist4qpseudo output variables when calling forecast_one or usual_model_forecast. To replicate those plots, you should then use plot_history_and_forecast to plot the 4Q average (rather than the default annualized plots). Currently, the packet generating code doesn't have the ability to plot 4Q averages, but it would likely just involve adding a keyword that needs to get passed around. If you do go down this route of adding a keyword to the packet generating code, it would certainly be appreciated if you then filed a pull request!
You will have to change the observables.jl file. See this documentation
The reason will be displayed to describe this comment to others. Learn more.
Dear William,
Concerning your answers:
When running the make_packet.jl code I get the following Error Message: LoadError: ArgumentError: column name : GDP not found in the data frame
It seems that somehow the code is not able to read the data. I already follow all the instructions regarding the FRED_API_KEY, and its currently working when I run the run_default.jl code.
I tried to run forecast_one but I get the following error: LoadError: UndefVarError: @Everywhere not defined
Regarding the usual_model_forecast, in the last Zip code that I downloaded, I couldn´t find the usual_model_forecas code.
The reason will be displayed to describe this comment to others. Learn more.
I'll need a more thorough error description to diagnose the problem (e.g. a screenshot)
I'm not sure where @Everywhere is getting called. Please provide the whole error message. The solution though is likely just add a using Distributed at the top of the script. Finally, please see src/packet/drivers. Also, I'd recommend using git protocol to clone the package rather than downloading as a zip. If you do that, then you can use git grep to find these functions more easily.
The reason will be displayed to describe this comment to others. Learn more.
Bug in the test script. Nothing wrong with forecast_one though. If you remove that line from the test script or add "using Distributed" at the top, it should be fine.
The reason will be displayed to describe this comment to others. Learn more.
1. I added "using Distributed" at the top, and it seemed that it was working until I get the following message (see pic):
2. Still not working...
3. I runned and it gives the same again this error (see pic)
4. Maybe is a problem of the versions of Julia and the DSGE package?
My Julia version is **1.1.1**, and DSGE package: **v1.1.5**
Do you have **Julia 1.1 for Mac** and the exact **DSGE version package** available to download? I followed [I](https://julialang.org/downloads/oldreleases/) but I couldn´t find Julia 1.1 for Mac...
The reason will be displayed to describe this comment to others. Learn more.
What's the error message now for the test?
Are you unable to see the code on Github? Are you using Internet explorer? Make sure you're using a browser which can use all of Github's features. Alternatively, you can just go to the file location directly inside DSGE via ~/.julia/packages/DSGE/5LCnG/src/packet/drivers.jl
Julia 1.1 and v1.1.5 should work together. I also did a clean install on my laptop (though using Julia 1.3) and the make_packet.jl code works (as well as loading data for AnSchorfheide). Can you show me your package versions by going into REPL, pressing ] (to enter Pkg mode) and then entering st?
The reason will be displayed to describe this comment to others. Learn more.
The Error Message is the following:
**Error evaluating forecast_one.jl
LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/fabrizioardiles/Desktop/DSGE.jl-master/test/forecast/forecast_one.jl:189
finish(::Test.DefaultTestSet) at Test.jl:847
top-level scope at Test.jl:1093
top-level scope at forecast_one.jl:191**
I am able to see the code on Github. When running it gives me the following result:
┌ Warning: Replacing docs for DSGE.usual_model_settings! :: Tuple{AbstractDSGEModel,String} in module DSGE
└ @ Base.Docs docs/Docs.jl:223
┌ Warning: Replacing docs for DSGE.usual_model_forecast :: Union{Tuple{AbstractDSGEModel,Symbol,Symbol}, Tuple{AbstractDSGEModel,Symbol,Symbol,Array{Symbol,1}}} in module DSGE
└ @ Base.Docs docs/Docs.jl:223
How can I know if the code worked?
And for Julia Version 1.1.1 will also work? or you recommend me to change the Julia Version.
The reason will be displayed to describe this comment to others. Learn more.
You can ignore the tests of forecast_one for now. We are currently in the process of updating them, so we'll catch these breaks and fix them.
If no errors are thrown (those warnings seem to be about the docstrings so you can ignore them), then it should have worker. There should be a folder in the DSGE.jl folder called "save" with the output. To see the exact path you can also call figurespath(m, "forecast").
Try updating FredData to v0.4 and let me know if there's a problem with that. It should work in 1.1 (I don't have it on my personal laptop so I can't check that a clean install will work in 1.1, but it works on my work computer, although it's not a clean install).
After looking for the folder I realized that I don't have the latest folder ".../folders" and for the case of the "save" folder it only generated an "input" folder and not an "output" folder as supposed.
FredData is already updated to version 0.4, but still get a message error (although different than previous error):
Reading dataset /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/../../save/input_data/
data/data_dsid=03_vint=181115.csv from disk...┌ Warning: df[obs_longinflation] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_longrate] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_tfp] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate1] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate2] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate3] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate4] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate5] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate6] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
dataset from disk valid
ERROR: LoadError: MethodError: no method matching forecast_one(::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}; forecast_string="", verbose=:high, shock_name=:none, shock_var_name=:none, shock_var_value=0.0, check_empty_columns=false, params=Float64[])
Closest candidates are:
forecast_one(::AbstractDSGEModel{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}; df, subset_inds, forecast_string, verbose, use_filtered_shocks_in_shockdec, shock_name, shock_var_name, shock_var_value, check_empty_columns, pegFFR, FFRpeg, H) at /Users/fabrizioardiles/.julia/packages/DSGE/5LCnG/src/forecast/drivers.jl:369 got unsupported keyword argument "params"
Stacktrace:
[1] kwerr(::NamedTuple{(:forecast_string, :verbose, :shock_name, :shock_var_name, :shock_var_value, :check_empty_columns, :params),Tuple{String,Symbol,Symbol,Symbol,Float64,Bool,Array{Float64,1}}}, ::Function, ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./error.jl:125
[2] (::getfield(DSGE, Symbol("#kw##forecast_one")))(::NamedTuple{(:forecast_string, :verbose, :shock_name, :shock_var_name, :shock_var_value, :check_empty_columns, :params),Tuple{String,Symbol,Symbol,Symbol,Float64,Bool,Array{Float64,1}}}, ::typeof(forecast_one), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./none:0
[3] #usual_model_forecast#1533(::String, ::String, ::Array{Float64,1}, ::Bool, ::Symbol, ::Symbol, ::Float64, ::Bool, ::Array{Float64,1}, ::typeof(usual_model_forecast), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at /Users/fabrizioardiles/Desktop/DSGE.jl-master/src/packet/drivers.jl:70
[4] (::getfield(DSGE, Symbol("#kw##usual_model_forecast")))(::NamedTuple{(:est_override, :forecast_string, :density_bands, :check_empty_columns),Tuple{String,String,Array{Float64,1},Bool}}, ::typeof(usual_model_forecast), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./none:0
[5] top-level scope at /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/make_packet.jl:83
in expression starting at /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/make_packet.jl:56
I just realized that I have the following the path:
The reason will be displayed to describe this comment to others. Learn more.
If you haven't successfully generated any output, then there's not going to be anything there. Since it seems you've been unable to load the data, you probably won't have made output yet.
It seems for some reason the forecast_one in v1.1.5 didn't have the params keyword added somewhere. Surprised this was the problem. Can you try comparing the forecast_one function at line 369 with the one on GitHub and seeing if you can match the keywords on your local version of the function to the one on Github? Otherwise, you'll have to wait until we release the new version (which hopefully should come out later this week or next week).
Not sure what you're referencing specifically here.
The reason will be displayed to describe this comment to others. Learn more.
Sadly but true...
I tried and still got a message error. I guess I will have to wait until the release of the new version. Can you please let me know when its available, so I can inmediately check it?
3.1. In the meantime, I will like to keep trying (I don´t want to give up). In that regard, I will like to replicate the same package versions that you have, so I can reduce the risk of getting errors. In that regard, Can you please send me the following detail of your personal computer that sucessfully runs the codes?
Julia Version
DSGE Package Version
FredData Version
I am using Atom/Julia in a Mac, I dont know if you are using a different one so I can try it as well.
What I was trying to refer is that if you try to run a command in Matlab, for example, and you don´t set correctly the "Path (Set Path)" in the folder of the code that you want to run, then is not going to show any result. I am not sure if happens the same with Julia, but when I looked at my "setting path" it was the follows:
I was just wondering what is the path of your personal laptop, maybe this could be my error.
The reason will be displayed to describe this comment to others. Learn more.
This is all I had to run
]activate . # enter Pkg mode and create a virtual environment to ensure a clean install
add DSGE
# st # optional, to see the packages
;cd ~/.julia/packages/DSGE/5LCnG/docs/examples # switch to the right location in shell mode
using Distributed
include("make_packet.jl")
To be able to use the latest code, you should then do
]dev DSGE
which will cause
using DSGE
to use the version of the package located in ~/.julia/dev/DSGE, which should include the COVID-19 code.
The reason will be displayed to describe this comment to others. Learn more.
I followed your instructions, but it seems that is somehow the data is not loading.
First, I ran the code ]dev DSGE and st to make sure that the dev DSGE package is working
Then I followed the other codes:
]activate . # enter Pkg mode and create a virtual environment to ensure a clean install
add DSGE
# st # optional, to see the packages
;cd ~/.julia/packages/DSGE/5LCnG/docs/examples # switch to the right location in shell mode
using Distributed
include("make_packet.jl")
Then I get the following error:
After that I ran the code m = Model1002() and it worked, and then I ran the code df = load_data(m) and I get the following error
The reason will be displayed to describe this comment to others. Learn more.
Thanks and sorry for the numerous questions. Fortunately, I could find the solution to my problem!
I pulled the DSGE.jl again and run successfully the code include("make_packet.jl") as well as include("forecast_one"). However after running include("make_packet.jl"), it haven't appeared any plot. I checked in the Workspace as well as in the Save/ Output_Data (See screenshots) but couldn't find any plot also...
I then checked the folder Save but I couldn't find any mentioned folder (see pic)
Regarding the script, I just followed your last message coding advice:
]dev DSGE
]activate . # enter Pkg mode and create a virtual environment to ensure a clean install
add DSGE
# st # optional, to see the packages
;cd ~/.julia/packages/DSGE/5LCnG/docs/examples # switch to the right location in shell mode
using Distributed
include("make_packet.jl")
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I am a researcher that is currently trying to use the FRBNY DSGE Model for my country. I read in the NEWS.md doc that "Model1002" update, considers now the impact of the COVID-19 pandemic. I am new in Julia. Can you please tell me the code to run "Model1002" that considers COVID-19?
Regards,
Fabrizio Ardiles
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Fabrizio,
Since you're new in Julia, you should definitely first familiarize yourself with Julia (the QuantEcon tutorials are very good). After that, you should read the DSGE documentation. As you read through the documentation, it may be helpful to also run some of the code in the example scripts provided.
For the adjustments to Model1002, you will need to
dev
the DSGE package since the adjustments are not yet part of an official release (this should be coming in the next week or so). Please see subspecs ss59-ss61 ofModel1002
in src/models/representative/m1002/subspecs.jl. To get a better idea of how these subspecs are used, I'd recommend reading our recent blog about it.Note that not all the features available for "standard" DSGE models in the package are available for the adjusted
Model1002
. Estimating the model, for example, is probably not going to work straight out of the box, and running full-distribution forecasts will require a bit of familiarity with the model. However, running modal exercises with the model should be straightforward.Let me know if you have more questions.
Best,
William
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your answer William,
I've already read the QuantEcon tutorials. Somehow, I'm not being able to see the DSGE documentation with codes in the example scripts provided (just read the DSGE documentation that describes theoretically the model). Can you please send me the doc or the link?.
Regards,
Fabrizio
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Fabrizio,
I was talking about this documentation. You can also navigate to it in the future by clicking the docs button on the main page of the package.
Best,
William
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much William!. One more thing. Do you have Julia 1.0.0 for Mac to download?. Somehow, I am not being able to find it...
Cheers,
Fabrizio
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here for old releases. I’d recommend downloading the newest release (1.42). While the DSGE v1.5 requires 1.1 or 1.0, future releases will work in all Julia 1.x versions.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear Chen,
Thank you so much for the provided documentation. Here is my current situation:
1. I´ve already update Julia's Version as well as DSGE´s Version Package. Fortunately, the file (run_default.jl) succeed!. What I am not so sure, is where I can see the results extracted from the solution of the DSGE model.
2. I am trying to replicate the plots provided in your recent blog [(https://libertystreeteconomics.newyorkfed.org/2020/06/the-new-york-fed-dsge-model-forecastjune-2020.html)]. Can you please tell me what is the code, so I can get that exact provided plots in your recent blog, and thus adapt the results with data for my country.
3 Finally, I am trying to change the data for the DSGE Model, but I am not so sure how to do it. Do you know how to do it?
Thanks in advance for your time,
Fabrizio A.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the make_packet.jl code for relatively automated generation of plots.
Unfortunately, the code for those precise plots are not part of the package and do involve some non-Julia formatting. However, you can replicate the exact lines/bands by using the plotting functionality in the package, namely
plot_history_and_forecast
. Please see the docstring for it in Julia REPL and it may be worthwhile to actually read the underlying code (see the src/plots folder). You will want to produce the:forecast4qobs, :forecast4qpseudo, :hist4qobs, :hist4qpseudo
output variables when callingforecast_one
orusual_model_forecast
. To replicate those plots, you should then useplot_history_and_forecast
to plot the 4Q average (rather than the default annualized plots). Currently, the packet generating code doesn't have the ability to plot 4Q averages, but it would likely just involve adding a keyword that needs to get passed around. If you do go down this route of adding a keyword to the packet generating code, it would certainly be appreciated if you then filed a pull request!You will have to change the observables.jl file. See this documentation
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear William,
Concerning your answers:
When running the make_packet.jl code I get the following Error Message:
LoadError: ArgumentError: column name : GDP not found in the data frame
It seems that somehow the code is not able to read the data. I already follow all the instructions regarding the FRED_API_KEY, and its currently working when I run the
run_default.jl
code.I tried to run
forecast_one
but I get the following error:LoadError: UndefVarError: @Everywhere not defined
Regarding the
usual_model_forecast
, in the last Zip code that I downloaded, I couldn´t find theusual_model_forecas
code.Thank you!. Already into it...
Thanks again for your time,
Fabrizio
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need a more thorough error description to diagnose the problem (e.g. a screenshot)
I'm not sure where @Everywhere is getting called. Please provide the whole error message. The solution though is likely just add a
using Distributed
at the top of the script. Finally, please seesrc/packet/drivers
. Also, I'd recommend using git protocol to clone the package rather than downloading as a zip. If you do that, then you can use git grep to find these functions more easily.38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find attached the "Error Messages Screenshots" after I run the following codes:
forecast_one
usual_model_forecast
make_packet jl
Fabrizio
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also try running the example in Julia 1.1?
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the error message now for the test?
Are you unable to see the code on Github? Are you using Internet explorer? Make sure you're using a browser which can use all of Github's features. Alternatively, you can just go to the file location directly inside DSGE via ~/.julia/packages/DSGE/5LCnG/src/packet/drivers.jl
Julia 1.1 and v1.1.5 should work together. I also did a clean install on my laptop (though using Julia 1.3) and the make_packet.jl code works (as well as loading data for AnSchorfheide). Can you show me your package versions by going into REPL, pressing
]
(to enter Pkg mode) and then enteringst
?38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Error evaluating forecast_one.jl
LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/fabrizioardiles/Desktop/DSGE.jl-master/test/forecast/forecast_one.jl:189
finish(::Test.DefaultTestSet) at Test.jl:847
top-level scope at Test.jl:1093
top-level scope at forecast_one.jl:191**
┌ Warning: Replacing docs for
DSGE.usual_model_settings! :: Tuple{AbstractDSGEModel,String}
in moduleDSGE
└ @ Base.Docs docs/Docs.jl:223
┌ Warning: Replacing docs for
DSGE.usual_model_forecast :: Union{Tuple{AbstractDSGEModel,Symbol,Symbol}, Tuple{AbstractDSGEModel,Symbol,Symbol,Array{Symbol,1}}}
in moduleDSGE
└ @ Base.Docs docs/Docs.jl:223
How can I know if the code worked?
This is my package versions so far:
(v1.1) pkg> st
Status
~/.julia/environments/v1.1/Project.toml
[c52e3926] Atom v0.12.18
[6e4b80f9] BenchmarkTools v0.5.0
[324d7699] CategoricalArrays v0.7.7
[34f1f09b] ClusterManagers v0.3.2
[6cf23378] DSGE v1.1.5
[a93c6f00] DataFrames v0.19.4
[1313f7d8] DataFramesMeta v0.5.0
[442a2c76] FastGaussQuadrature v0.4.2
[5789e2e9] FileIO v1.4.0
[6e85b7ee] FredData v0.3.1
[38e38edf] GLM v1.3.9
[f67ccb44] HDF5 v0.12.5
[43edad99] InstantiateFromURL v0.4.0
[a98d9a8b] Interpolations v0.12.10
[4138dd39] JLD v0.10.0
[033835bb] JLD2 v0.1.14
[e5e0dc1b] Juno v0.8.2
[e47e5152] ModelConstructors v0.1.12
[4d1e1d77] Nullables v0.0.8
[bac558e1] OrderedCollections v1.3.0
[91a5bcdd] Plots v0.27.1
[1fd47b50] QuadGK v2.4.0
[fcd29c91] QuantEcon v0.16.2
[1a8c2f83] Query v0.12.2
[ce6b1742] RDatasets v0.6.9
[d519eb52] RegressionTables v0.4.0
[112f6efa] VegaLite v1.0.0
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can ignore the tests of forecast_one for now. We are currently in the process of updating them, so we'll catch these breaks and fix them.
If no errors are thrown (those warnings seem to be about the docstrings so you can ignore them), then it should have worker. There should be a folder in the DSGE.jl folder called "save" with the output. To see the exact path you can also call
figurespath(m, "forecast")
.Try updating FredData to v0.4 and let me know if there's a problem with that. It should work in 1.1 (I don't have it on my personal laptop so I can't check that a clean install will work in 1.1, but it works on my work computer, although it's not a clean install).
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
I ran the code
figurespath(m, "forecast")
and I got the following result:"/var/folders/7p/_3nh7jv513db4jkqll295jmc0000gn/T/output_data/an_schorfheide/ss0/forecast/figures"
After looking for the folder I realized that I don't have the latest folder ".../folders" and for the case of the "save" folder it only generated an "input" folder and not an "output" folder as supposed.
Reading dataset /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/../../save/input_data/
data/data_dsid=03_vint=181115.csv from disk...┌ Warning: df[obs_longinflation] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_longrate] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_tfp] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate1] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate2] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate3] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate4] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate5] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
┌ Warning: df[obs_nominalrate6] is all missing.
└ @ DSGE ~/.julia/packages/DSGE/5LCnG/src/data/load_data.jl:412
dataset from disk valid
ERROR: LoadError: MethodError: no method matching forecast_one(::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}; forecast_string="", verbose=:high, shock_name=:none, shock_var_name=:none, shock_var_value=0.0, check_empty_columns=false, params=Float64[])
Closest candidates are:
forecast_one(::AbstractDSGEModel{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}; df, subset_inds, forecast_string, verbose, use_filtered_shocks_in_shockdec, shock_name, shock_var_name, shock_var_value, check_empty_columns, pegFFR, FFRpeg, H) at /Users/fabrizioardiles/.julia/packages/DSGE/5LCnG/src/forecast/drivers.jl:369 got unsupported keyword argument "params"
Stacktrace:
[1] kwerr(::NamedTuple{(:forecast_string, :verbose, :shock_name, :shock_var_name, :shock_var_value, :check_empty_columns, :params),Tuple{String,Symbol,Symbol,Symbol,Float64,Bool,Array{Float64,1}}}, ::Function, ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./error.jl:125
[2] (::getfield(DSGE, Symbol("#kw##forecast_one")))(::NamedTuple{(:forecast_string, :verbose, :shock_name, :shock_var_name, :shock_var_value, :check_empty_columns, :params),Tuple{String,Symbol,Symbol,Symbol,Float64,Bool,Array{Float64,1}}}, ::typeof(forecast_one), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./none:0
[3] #usual_model_forecast#1533(::String, ::String, ::Array{Float64,1}, ::Bool, ::Symbol, ::Symbol, ::Float64, ::Bool, ::Array{Float64,1}, ::typeof(usual_model_forecast), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at /Users/fabrizioardiles/Desktop/DSGE.jl-master/src/packet/drivers.jl:70
[4] (::getfield(DSGE, Symbol("#kw##usual_model_forecast")))(::NamedTuple{(:est_override, :forecast_string, :density_bands, :check_empty_columns),Tuple{String,String,Array{Float64,1},Bool}}, ::typeof(usual_model_forecast), ::Model1002{Float64}, ::Symbol, ::Symbol, ::Array{Symbol,1}) at ./none:0
[5] top-level scope at /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/make_packet.jl:83
in expression starting at /Users/fabrizioardiles/Desktop/DSGE.jl-master/docs/examples/make_packet.jl:56
"/Users/fabrizioardiles/Desktop/DSGE.jl-master/test/plot"
Maybe that's the problem for getting errors?
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you haven't successfully generated any output, then there's not going to be anything there. Since it seems you've been unable to load the data, you probably won't have made output yet.
It seems for some reason the forecast_one in v1.1.5 didn't have the params keyword added somewhere. Surprised this was the problem. Can you try comparing the forecast_one function at line 369 with the one on GitHub and seeing if you can match the keywords on your local version of the function to the one on Github? Otherwise, you'll have to wait until we release the new version (which hopefully should come out later this week or next week).
Not sure what you're referencing specifically here.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly but true...
I tried and still got a message error. I guess I will have to wait until the release of the new version. Can you please let me know when its available, so I can inmediately check it?
3.1. In the meantime, I will like to keep trying (I don´t want to give up). In that regard, I will like to replicate the same package versions that you have, so I can reduce the risk of getting errors. In that regard, Can you please send me the following detail of your personal computer that sucessfully runs the codes?
I am using Atom/Julia in a Mac, I dont know if you are using a different one so I can try it as well.
I was just wondering what is the path of your personal laptop, maybe this could be my error.
Pd. Thanks for all your help!
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all I had to run
To be able to use the latest code, you should then do
which will cause
to use the version of the package located in
~/.julia/dev/DSGE
, which should include the COVID-19 code.Note that I think the reason your code wasn't working is because you directly git cloned the package rather than using
dev
. See https://julialang.github.io/Pkg.jl/v1/managing-packages/#Developing-packages-138a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed your instructions, but it seems that is somehow the data is not loading.
First, I ran the code
]dev DSGE
andst
to make sure that thedev
DSGE package is workingThen I followed the other codes:
Then I get the following error:
After that I ran the code
m = Model1002()
and it worked, and then I ran the codedf = load_data(m)
and I get the following error38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks and sorry for the numerous questions. Fortunately, I could find the solution to my problem!
I pulled the DSGE.jl again and run successfully the code
include("make_packet.jl")
as well asinclude("forecast_one")
. However after runninginclude("make_packet.jl")
, it haven't appeared any plot. I checked in the Workspace as well as in the Save/ Output_Data (See screenshots) but couldn't find any plot also...38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What path is yielded by
joinpath(saveroot(m), "Packets", spec(m), subspec(m))
? Also, what doesfigurespath(m, "forecast")
yield?If you can't find anything in those folder locations, then the plot creation code must not be running. Are you sure you're running the entire script?
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path
joinpath(saveroot(m), "Packets", spec(m), subspec(m))
yields:"/Users/fabrizioardiles/.julia/packages/DSGE/5LCnG/docs/examples/../../save/Packets/m1002/ss10"
Path
figurespath(m, "forecast")
yields:"/Users/fabrizioardiles/.julia/packages/DSGE/5LCnG/docs/examples/../../save/output_data/m1002/ss10/forecast/figures"
I then checked the folder Save but I couldn't find any mentioned folder (see pic)
Regarding the script, I just followed your last message coding advice:
That is the entire script right?
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I am Shino from Japan.
Your estimation, which includes the effect of covid-19, by DSGE is quite interesting.
When I tried
julia> include("make_packet.jl")
the following error appears.
Creating dataset...
ERROR: LoadError: FRED API Key not detected.
...
It looks that FredData.jl is not working well.
In this case, what should I do?
Thank you.
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see https://github.com/micahjsmith/FredData.jl
Best,
William
38a1a07
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.