This project is read-only.

Panel VAR

Jul 16, 2015 at 5:26 PM
I am newbie to both MATLAB and Iris Toolbox and I need to estimate 8 variable panel VAR for 59 panels for my research. I have run through the provided tutorials for which I thank a lot all those people who contributed to developing ToolBox and tutorials.
I see that for panel VAR one manipulates 3 CSV files and then imports them into a datastruct. Then the command creating empty VAR object "VAR" asks for declaration of groups and with such data structure it seems straightforward how to specify.
My question: I already have panel data arranged in single CSV containing all the information for all 59 panels. How do I go about specifying groups for VAR?
Jul 17, 2015 at 12:00 AM
You need to put your data in a format such that there is a struct which contains one field for each country, and that field is itself another struct with the variables for that country. This can be accomplished using the dbload() command multiple times, with one CSV file for each country, as in the example; or it can be accomplished afterward. In order to provide specific instructions we would need to see your code and/or data. You can then subsequently call the VAR constructor with the 'groups=' option to specify the country names which correspond to the field names in the top level of your struct. Makes sense?
Marked as answer by jaromirbenes on 7/17/2015 at 12:03 PM
Jul 17, 2015 at 5:00 PM
Edited Jul 17, 2015 at 6:12 PM
OK thank you! I have converted my data into 59 CSV files. First, I am unable to import at this stage with:
a = struct();
a.Arg= dbload('Data_Argenti.csv', ...
'userDataFieldList=',1, ...
'commentRow=','quarter', ...
'nan', '.');
I get an error a.Arg is struct with no fields.
Second, can I dbload all 59 CSV files in my directory using some loop? Or need to run it 59 times? I want fieldnames of struct the same as names of CSV files.
Jul 17, 2015 at 8:02 PM
Can you please email me you original CSV file, and I'll show you how to create a corresponding struct with sub-structs (it's easier to do it off a single CSV file using Matlab commands, rather than manually creating a large number of separate CSV files). My email address is jaromir (dot) benes (at) gmail (dot) com.
Marked as answer by jaromirbenes on 7/17/2015 at 12:03 PM
Jul 18, 2015 at 3:37 PM
Edited Jul 18, 2015 at 3:38 PM
I have emailed you (message from sergeykozik1993 (at) gmail (dot) com). I highly appreciate your help, I am stuck with this problem completely... Can`t figure out how to use 'userDataField=' option...