Thursday, December 23, 2010

Input Output Table Analysis using PyIO ( for Large Matrix )

Recently, I have a paper assignment from my economic modelling class and spend some time to play around with PyIO, a python based application that enable IO table analysis, for sometimes. It's a great apps (not to mention it is free, fast and easy) and it had greatly reduced the amount of time for me to understand how the IO calculation actually works.

Actually you can use Matlab, Octave or mathCAD to do this, but I believe you would require more time in learning the entry command, matrix operation, balancing the table, do data transformation back and forth, etc. You wont like it, trust me !

So I decided to give PyIO a go and installed this software on my Vista 64-bit, 4 GB Memory. MS Excel is not required, but it is nice to have. I do the following to 2005 BPS 66 x 66 sector operations:

Tested and Working:
1. Sector aggregation,
2. Leontief Inverse,
3. Ghoshian Inverse,
4. Impact Analysis,
5. Output, Input, Income, Employment multiplier,
6. Key Sector Analysis (Forward & Backward Linkage), (This is imperative)
7. Multiplier Product Matrix Analysis, (This is interesting)
8. Extracting method (Removing 1 sector from the economy,
9. Push-Pull Analysis (Difficult to understand, various probability),
10. Field of Influence

Not yet tested (but it should be working though):
1. RAS update
2. Output Decomposition

Basically everything works fine, the result can be chosen, between "Interactive Excel Data Entry" or "Tab Separated Format". I often choose the later. However I did encounter serious problem when I inputted a 175 x 175 matrix. The matrix wont showed-up (as shown in the pic below). After further inspection into the code, I saw what may have caused it, apparently the windows size is hardcoded so that the horizontal grid is maxed out to a just (100-3) cells = 97 cells, arrgghh... awfully pity !

Crawling to various URL in the internet (Google search power is getting worst and worst these days, geezz..), I see a lot of junk of information regarding PyIO, no solutions of how to overcame large matrix calculation limit. I also have tried various ways from downloading py2exe apps, trying to re-write the code, but to no avail. Tired of trying, I abandon the idea of using PyIO for calculating large matrices, but that is until recently, when I uncovered that I can large matrices calculation with it..

So How?

Just use PyIO older version ("Lowtek rulez eh ?"), the one with command line, this older version is much more powerful than you think. You can download it from here: http://www.real.illinois.edu/pyio/OldversionsPyIO/pyio.zip

In the future, it will be hard to find them all, so I took the initiative to preserve this PyIO release and pack them into one zip consisting of:

  1. PyIO version 1.0
  2. Python-2.2.3
  3. Mark Hammond win32all-152.exe
  4. Numeric-23.0.win32-py2.2.exe (no longer available)
  5. Some PDF/Whitepapers mentioned in the PyIO manual
  6. Indonesian 2005 66x66 sectors and 175x175 sectors (Producers Prices), Employment, Income. (provided as-is, accuracy is not guaranteed)

You can download it from here: (multiple download link will soon be available). Credits goes to the respective apps programmers/contributors.

Instructions:

  1. Install package #2, #3, #4.. (see above)
  2. Install package #1, all into the same folder
  3. Copy your input file (in this case 175sector.txt and/or 66sector.txt into that folder too,
  4. Start -> run -> cmd
  5. Navigate to the folder, using multiple cd command
  6. type python.exe run_pyio.py, a screen like this should appear:

  7. Once you are in the menu, just type what you want to calculate, for example for "key sector analysis" then type "3" and then type"1" , enter the file name "175sector.txt", dont use excel output if you are calculating a large matrix because the result will not appear instantly, so just use the text file.
  8. Rename the output file *.out to *.txt, and use Excel to open it. All cell
    should be displayed nicely.
Okay, that's all from me, make a good use of them (what i actually mean is "Abuse It!!" :) ) , and....
Have Fun !

2 comments:

  1. The requested URL /pyio/OldversionsPyIO/pyio.zip was not found on this server.

    ReplyDelete
  2. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    ReplyDelete