aim_solve (DSGE model simulation)
Moderators: EViews Gareth, EViews Moderator, EViews Esther
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13415
- Joined: Tue Sep 16, 2008 5:38 pm
aim_solve (DSGE model simulation)
This thread is about the aim_solve Add-in. This add-in, developed by the Flint Brayton of the FRB, provides a way to simulate DSGE models.
The add-in comes with PDF documentation, along with two examples of use. We recommend looking through the examples as the best way to learning how to use the Add-in.
The add-in comes with PDF documentation, along with two examples of use. We recommend looking through the examples as the best way to learning how to use the Add-in.
Follow us on Twitter @IHSEViews
Re: aim_solve (DSGE model simulation)
Many thanks to Flint Brayton for this very useful start on simulating DSGEs in EViews!
Users should note that, at least in my experience, it will work only with R versions 2.12.1 or later.
Regards
Donihue
Users should note that, at least in my experience, it will work only with R versions 2.12.1 or later.
Regards
Donihue
How to use aim_solve with versions of R prior to 2.12
Hi:
The aim_solve add-in will in fact work with versions of R prior to 2.12, but users of such versions must use the following method to instal the AMA package:
1. Start R
2. Enter: options(repos=c(CRAN = "ftp://cran.r-project.org/pub/R"))
3. Enter: install.packages("AMA")
I've used these steps successfully with R 2.10.1.
While I'm here, a few notes and acknowledgements: AMA stands for the Anderson-Moore Algorithm, a well-known procedure for solving linear rational expectations models that was written by FRB colleagues Gary Anderson and George Moore. The primary version of the code has for many years been in Matlab. The algorithm was ported to R in 2010 by Gary and Aneesh Raghunandan. Once the R code was completed, Peter Chen and I wrote the aim_solve add-in to provide an EViews interface to the algorithm.
The aim_solve add-in will in fact work with versions of R prior to 2.12, but users of such versions must use the following method to instal the AMA package:
1. Start R
2. Enter: options(repos=c(CRAN = "ftp://cran.r-project.org/pub/R"))
3. Enter: install.packages("AMA")
I've used these steps successfully with R 2.10.1.
While I'm here, a few notes and acknowledgements: AMA stands for the Anderson-Moore Algorithm, a well-known procedure for solving linear rational expectations models that was written by FRB colleagues Gary Anderson and George Moore. The primary version of the code has for many years been in Matlab. The algorithm was ported to R in 2010 by Gary and Aneesh Raghunandan. Once the R code was completed, Peter Chen and I wrote the aim_solve add-in to provide an EViews interface to the algorithm.
Re: aim_solve (DSGE model simulation)
Thanks for the note on installing AMA on earlier R versions.
"While you are there", could I ask if there is some simple way to avoid having the various "work_" elements appear in the workfile? (They add up when one does various versions of the model in the same workfile.) I looked at your code to see if I could do it myself, but was somewhat overwhelmed by it ...
Also, your examples seem to allow for only one shock variable; it is of course possible to do others via EViews scenarios, but is there any fundamental reason one could not add other shock variables in your examples?
Regards
Donihue
"While you are there", could I ask if there is some simple way to avoid having the various "work_" elements appear in the workfile? (They add up when one does various versions of the model in the same workfile.) I looked at your code to see if I could do it myself, but was somewhat overwhelmed by it ...
Also, your examples seem to allow for only one shock variable; it is of course possible to do others via EViews scenarios, but is there any fundamental reason one could not add other shock variables in your examples?
Regards
Donihue
Re: aim_solve (DSGE model simulation)
Hi:
1. You may have included the aim_solve "debug" option. When it is not included, the "work_" files are deleted from the workspace unless the execution of the add-in halts at some intermediate point because of an error. In the latter case, I think you can delete all the temporary files with: delete work_*.
2. The number of shocks that can be included in a simulation is only limited by the scope of the model. The examples only include a single shock for simplicity.
Good luck.
1. You may have included the aim_solve "debug" option. When it is not included, the "work_" files are deleted from the workspace unless the execution of the add-in halts at some intermediate point because of an error. In the latter case, I think you can delete all the temporary files with: delete work_*.
2. The number of shocks that can be included in a simulation is only limited by the scope of the model. The examples only include a single shock for simplicity.
Good luck.
Re: aim_solve (DSGE model simulation)
Hello,
Thanks for your reply.
I guess that the relevant part of the "aim_solve" programme is the set of lines near the beginning:
if @hasoption("debug") then
%debug = "yes"
endif
which trigger the lines near the end:
if %debug = "yes" then
show aim_solve_work
else
for !i = 1 to @wcount(%worknames)
%abc = @word(%worknames,!i)
%bcd = "%" + %abc
delete(noerr) {%bcd}
next
endif
In fact, I did not set the "debug" option, so it is a mystery to me why the elements should be there at all.
As a practical matter, I did as you suggested and deleted them by hand.
Regards
Donihue
Thanks for your reply.
I guess that the relevant part of the "aim_solve" programme is the set of lines near the beginning:
if @hasoption("debug") then
%debug = "yes"
endif
which trigger the lines near the end:
if %debug = "yes" then
show aim_solve_work
else
for !i = 1 to @wcount(%worknames)
%abc = @word(%worknames,!i)
%bcd = "%" + %abc
delete(noerr) {%bcd}
next
endif
In fact, I did not set the "debug" option, so it is a mystery to me why the elements should be there at all.
As a practical matter, I did as you suggested and deleted them by hand.
Regards
Donihue
Re: aim_solve (DSGE model simulation)
Hello, with your helpful suggestions in the forums, I have installed the aim add-in successfulyy. But when i begin to run the example , I met a ERROR MESSAGE "WORK_01 is not defined in "DELETE(NOERR)"WORK_01". I tried the example1 and example2, but both failed. Their error messages are exactly the same.
Then I checked ,and found the "aim_solve_work " file may have something wrong. The first line and the second line both discribe the WORK_01. However, there is no line discribes the WORK_02. I think maybe each discription for each WORK only.
I really confused with this failure in running the aim_solve add-in examples. Looking forwared to your helpful reply.
Best Regards
Then I checked ,and found the "aim_solve_work " file may have something wrong. The first line and the second line both discribe the WORK_01. However, there is no line discribes the WORK_02. I think maybe each discription for each WORK only.
I really confused with this failure in running the aim_solve add-in examples. Looking forwared to your helpful reply.
Best Regards
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13415
- Joined: Tue Sep 16, 2008 5:38 pm
Re: aim_solve (DSGE model simulation)
Please update to the latest version of EViews 7.1. A recent patch broke the delete(noerr) command. It is fixed in the latest patch.
Follow us on Twitter @IHSEViews
Re: aim_solve (DSGE model simulation)
Many Thanks to your rapid reply.Please update to the latest version of EViews 7.1. A recent patch broke the delete(noerr) command. It is fixed in the latest patch.
You are right, it now works.
:D
Re: aim_solve (DSGE model simulation)
Hello, I have installed the aim add-in and the R software version 2.15.1 successfuly. But when i begin to run the examples (1 and 2), I get the follow ERROR MESSAGE:
statconnDCOM x86
(C) 1998-2012, Thomas Baier
Version: 3.5-1B1
> library('AMA')
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package 'rJava' could not be loaded
R (for 'library('AMA')') returned an error: evaluation stopped because of an error.
Can you help me please?
Thanks
statconnDCOM x86
(C) 1998-2012, Thomas Baier
Version: 3.5-1B1
> library('AMA')
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package 'rJava' could not be loaded
R (for 'library('AMA')') returned an error: evaluation stopped because of an error.
Can you help me please?
Thanks
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13415
- Joined: Tue Sep 16, 2008 5:38 pm
Re: aim_solve (DSGE model simulation)
Open up R, click on the Packages menu, click on Install Package, and then select the AMA package.
Follow us on Twitter @IHSEViews
Re: aim_solve (DSGE model simulation)
Thanks for your quick answer, but I have installed the last version of the AMA package in the R software's folder called Library. Also, I have installed the rJava package in the same folder. I have tested a lot of things, but anything it works, always the same error message.Open up R, click on the Packages menu, click on Install Package, and then select the AMA package.
Please, do you have another idea about it?
Thanks
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13415
- Joined: Tue Sep 16, 2008 5:38 pm
Re: aim_solve (DSGE model simulation)
Unfortunately not. I have a brand new computer, just installed EViews, then installed RandFriends, installed the AMA package in R, then ran the add-in, and it worked without any problems :(
Follow us on Twitter @IHSEViews
Re: aim_solve (DSGE model simulation)
Thanks again, I'll keep tryingUnfortunately not. I have a brand new computer, just installed EViews, then installed RandFriends, installed the AMA package in R, then ran the add-in, and it worked without any problems :(
Re: aim_solve (DSGE model simulation)
I tried to replicate examples 1 and 2, but the program stopped before it finish, and show this message:
AIM_solve is not a valid view
when i try to install the package ‘AMA’, R tell me that: ‘AMA’ is not available (for R version 2.15.0)
the only way is to return to a previous version? :S
AIM_solve is not a valid view
when i try to install the package ‘AMA’, R tell me that: ‘AMA’ is not available (for R version 2.15.0)
the only way is to return to a previous version? :S
Who is online
Users browsing this forum: No registered users and 1 guest