aim_solve (DSGE model simulation)

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

aim_solve (DSGE model simulation)

Postby EViews Gareth » Mon Feb 07, 2011 2:56 pm

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.
Follow us on Twitter @IHSEViews

donihue
Posts: 135
Joined: Wed Oct 07, 2009 8:51 am

Re: aim_solve (DSGE model simulation)

Postby donihue » Tue Feb 08, 2011 7:15 am

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

fbrayton
Posts: 21
Joined: Wed Nov 05, 2008 11:09 am

How to use aim_solve with versions of R prior to 2.12

Postby fbrayton » Tue Feb 08, 2011 7:57 am

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.

donihue
Posts: 135
Joined: Wed Oct 07, 2009 8:51 am

Re: aim_solve (DSGE model simulation)

Postby donihue » Tue Feb 08, 2011 11:38 am

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

fbrayton
Posts: 21
Joined: Wed Nov 05, 2008 11:09 am

Re: aim_solve (DSGE model simulation)

Postby fbrayton » Tue Feb 08, 2011 2:19 pm

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.

donihue
Posts: 135
Joined: Wed Oct 07, 2009 8:51 am

Re: aim_solve (DSGE model simulation)

Postby donihue » Tue Feb 08, 2011 5:22 pm

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

Flora62
Posts: 2
Joined: Tue Mar 15, 2011 7:24 pm

Re: aim_solve (DSGE model simulation)

Postby Flora62 » Tue Mar 15, 2011 7:52 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: aim_solve (DSGE model simulation)

Postby EViews Gareth » Tue Mar 15, 2011 7:56 pm

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

Flora62
Posts: 2
Joined: Tue Mar 15, 2011 7:24 pm

Re: aim_solve (DSGE model simulation)

Postby Flora62 » Tue Mar 15, 2011 8:47 pm

EViews Gareth wrote: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.


Many Thanks to your rapid reply.
You are right, it now works.
:D

gusbieder
Posts: 3
Joined: Wed Sep 19, 2012 7:52 am

Re: aim_solve (DSGE model simulation)

Postby gusbieder » Wed Sep 19, 2012 8:22 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: aim_solve (DSGE model simulation)

Postby EViews Gareth » Wed Sep 19, 2012 9:39 am

Open up R, click on the Packages menu, click on Install Package, and then select the AMA package.
Follow us on Twitter @IHSEViews

gusbieder
Posts: 3
Joined: Wed Sep 19, 2012 7:52 am

Re: aim_solve (DSGE model simulation)

Postby gusbieder » Wed Sep 19, 2012 10:41 am

EViews Gareth wrote:Open up R, click on the Packages menu, click on Install Package, and then select the AMA package.


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.
Please, do you have another idea about it?
Thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: aim_solve (DSGE model simulation)

Postby EViews Gareth » Wed Sep 19, 2012 10:49 am

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

gusbieder
Posts: 3
Joined: Wed Sep 19, 2012 7:52 am

Re: aim_solve (DSGE model simulation)

Postby gusbieder » Wed Sep 19, 2012 12:02 pm

EViews Gareth wrote: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 :(

Thanks again, I'll keep trying

agranda
Posts: 4
Joined: Thu Dec 29, 2011 7:40 am

Re: aim_solve (DSGE model simulation)

Postby agranda » Mon Oct 29, 2012 4:15 pm

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


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 10 guests