Research

A Super-Quick Proxy on Mac

Thursday, October 25th, 2007 -- By ET

I sometimes use MIT’s VPN to download obscure papers from the MIT library. To do it, you have to have an MIT IP address. The MIT VPN software allows me to obtain one.

I sometimes also download files through BitTorrent (for legitimate files of course), and HKUST blocks this kind of traffic. So the VPN proved also useful.

This trick can be used in mainland China, too. Last time when I visited Shanghai, I tried to access a Wikipedia article (in fact, I was writing a wikipedia paper, and needed to check the page). Due to the block in China, I could not access Wikipedia directly, so the MIT VPN was used again. Alternatively, I can set up a quick proxy connection in my Mac. Here is how:

open Terminal, and type:

ssh -ND 9999 zxq@mikezhang.com

where “ssh” is the command to connect to the server “mikezhang.com”, which is hosted in California. “zxq” is my login name on that server. The “-ND 9999″ part tells the machine to keep the connection and use it as a proxy server.

That’s all, then I just need to go to Firefox to set up the proxy. Below is how, just choose “Manual” and change the port for “SOCKS Host” to 9999.

socksfirefoxconnection.png

Should I go to Montreal

Tuesday, October 9th, 2007 -- By ET

Just got the notification that my paper with Feng Zhu got accepted by this year’s WISE (Workshop on Information Systems and Economics).  This put some weight on the “going” side of this dilemma.

There are reasons that I should not go

1. I’ve been to Montreal before, and going there in winter is not a good idea (guess global warming is convenient in this case)

2. I’ve already went on two trips to the US in the last 4 months.  According to various studies, jet lag and sleeping disorders can cause serious problems in decision making.

3. I have a few projects going on, and I would really have good use of that period of time for research.

There are a few reasons I should go:

1. The paper got accepted, and I like it a lot, very eager to present it

2. My friend Feng is on the market, I should go to give him the support he needs

3. We are hiring this year, I’d be eager to see who are the other candidates

I guess this blog entry helps me to organize the thoughts a little bit, and after writing it, I guess I should go…

Bayesian Resources from Alex

Monday, October 8th, 2007 -- By ET

http://www.biosino.org/R/R-doc/

Chinese site on R-language, with the link to download. There are two notes
on introduction to R with translation in Chinese.

http://cran.r-project.org/ <http://cran.r-project.org/other-docs.html>

The R project site, with documentations.

http://www.mrc-bsu.cam.ac.uk/bugs/

BUGS site. According to

Title An introduction to modern Bayesian econometrics / Tony Lancaster

It is possible to run the BUGS package in Matlab, I will try to figure it
out.

http://faculty.chicagogsb.edu/peter.rossi/teaching/37904/index.htm

Course sites on Bayesian Stat in Marketing, offerred by Peter Rossi. Papers,
lecture slides…

http://faculty.chicagogsb.edu/peter.rossi/research/bsm.html

Suppliments on Bayesian Statistics and Marketing.

http://ite.gmu.edu/~klaskey/SYST664/SYST664.html

Another site for course on Bayesian Stat. More statistics focused.

Predicting This Year’s Nobel Prize Winner

Monday, October 8th, 2007 -- By ET

Of course, I mean the Nobel Prize for Economics.

Here is a link to Prof. Greg Mankiw’s post http://gregmankiw.blogspot.com/2007/10/my-bet-on-nobel.html, he, as an economist, used data to show that past winners all got huge amount of citations.

I wrote a few papers on predicting movie sales from word-of-mouth. The one using a Bayesian Model gives amazing power. A hollywood media consulting company emailed us (my co-authors Prof. Chris Dellarocas, Prof. Neveen Awad and I) about creating a software to do the predictions. I guess that model could have gotten us quite some money, however, we had more fun things to do than to work on a software.

For this issue, I don’t have data. So let me use a behavioral method to predict (a.k.a guess).

Some people said Romer and Tirole, I don’t think they can be put together. They are working in different areas, and they are kind of young for Nobel. Romer is invited to UST for an IAS talk, they typically only invite nobel prize winners, so I guess he has a good chance this time, if not next. Tirole is amazing, I liked his papers, his books, and his lectures (He came to MIT to guest lecture in the IO class. Erik and I went to him once to consult about our idea on innovation incentives. He pointed us to some Michael Spence’s papers, they can not be more relevant). Only problem is that he’s too young.

I was reading quite a few papers on efficient market hypothesis these days due to a project on price’s informational role in asset markets. (Why I’m writing a finance paper? This is related to information! And to me, everything related to information is related to information technology). Fama and Shleifer were quoted so many times. I’m not a big fun of EMH (efficient market hypothesis), but who ever contributed to it lead finance into the prime time in b-schools. Fama should definitely be credited for it.

I took Holmstrom’s class, he has some very influential papers, so I guess he has a good chance.

Robert Gordon contributed significantly to Macroeconomics, but under two grounds I don’t think he’s the one. 1. there has been some recent awards in Macro, can’t be so soon. 2. he really doesn’t understand IT and its impact to the society. I was totally disappointed by his keynote speech in last year’s WISE conference at Northwestern U.

Overall, I would vote for Fama and Shleifer. If I can not do it correctly, I’ll develop a Bayesian model on this next year. :-)

Can’t wait till Oct 15 to get the result.

Forthcoming Seminars at the Institute of Advanced Studies

Sunday, October 7th, 2007 -- By ET

Really look forward to some of them.

 

October 9

Numerical Simulation of Particle Clustering for Particulate Flow in a Spinning Cylinder

Prof Roland Glowinski

Department of Mathematics and Department of Mechanical Engineering

University of Houston

October 26

New Directions in Science: The Search for Fractional Charge Particles

Prof Martin Perl

Stanford Linear Accelerator Center

Stanford University

Nobel Laureate in Physics

October 29

Entrepreneurship and Incentives

Prof James Mirrlees

Chinese University of Hong Kong and University of Cambridge

Nobel Laureate in Economics

November 9

Reference Points and Theory of the Firm

Prof Oliver Hart

Department of Economics

Harvard University

November 16

Prof Paul Romer

Graduate School of Business

Stanford University

November 20

Prof Karoly Nikolich

Neuroscience Institute

Stanford University

December 3-7

Prof George Papanicolaou

Department of Mathematics

Stanford University

December 9-13

Workshop on Mathematics of Multi-Scale Problems

iTunes University @MIT

Saturday, August 25th, 2007 -- By ET

If you have an iPod, and want to keep studying new things, you can actually download MIT lectures and watch them.

Just go to this page. You can find a lot of courses to choose from. This is part of MIT’s opencourseware project.

The following is a screen shot for the course “Differential Equations”.

itunes_mitu.jpg

My Perl IDE

Monday, July 9th, 2007 -- By ET

snap1.jpg

 

I wanted to write “The Best Perl IDE” on the title, but on a second thought, I have decided not.  There are so many good ones out there, why would this be the best?  Anyway, I think it is the best for me.  It is extremely compact, but fits my need.  Beauty is simplicity.

It is called SciTe.  The one I’m using has only one file. Only 500KB.  You can type in the code on the left panel, and the result will be shown on the right panel.

More information can be found here.

SciTE currently is able to syntax style these languages (* denotes support for folding):

  • Ada
  • ANS.1 MIB definition files*
  • APDL
  • Assembler (NASM, MASM)
  • AutoIt*
  • Avenue*
  • Batch files (MS-DOS)
  • Baan*
  • Bash*
  • BlitzBasic*
  • Bullant*
  • C/C++/C#*
  • Clarion*
  • conf (Apache)*
  • CSound*
  • CSS*
  • diff files*
  • E-Script*
  • Eiffel*
  • Erlang*
  • Flagship (Clipper / XBase)*
  • Flash (ActionScript)*
  • Fortran*
  • Forth*
  • Haskell
  • HTML*
  • HTML with embedded JavaScript, VBScript, PHP and ASP*
  • Gui4Cli*
  • IDL - both MSIDL and XPIDL*
  • INI, properties* and similar
  • InnoSetup*
  • Java*
  • JavaScript*
  • LISP*
  • LOT*
  • Lout*
  • Lua*
  • Make
  • Matlab*
  • Metapost
  • MMIXAL
  • MSSQL
  • nnCron
  • NSIS*
  • Objective Caml*
  • Opal
  • Octave*
  • Pascal/Delphi*
  • Perl, most of it except for some ambiguous cases*
  • PostScript*
  • POV-Ray*
  • PowerBasic*
  • PureBasic*
  • Python*
  • Rebol*
  • Ruby*
  • Scheme*
  • scriptol*
  • Specman E*
  • Spice
  • Smalltalk
  • SQL and PLSQL
  • TADS3*
  • TeX and LaTeX
  • Tcl/Tk*
  • VB and VBScript*
  • Verilog*
  • VHDL*
  • XML*
  • YAML*

Bibtex Entry Extractor/Subsetter

Wednesday, July 4th, 2007 -- By ET

Suppose you have a LaTeX file (e.g. latexfile.tex) with some BibTeX entries (in the form of \citet{zhang2007,dellarocas2006}, etc). Suppose these entries can be found in a huge bibtex file (e.g. references.bib) that includes more than 1000 bibtex entries.

When you are done with the $$LaTeX[/tex] file, you want to send out the paper to a journal. One way is to include this “references.bib” file with the latexfile.tex file. However, it is very difficult for the editors of the journal to use your huge file. It would be ideal if there could be a program to extract the right subset of references from the references.bib file and create a specific bibtex file for your article (latexfile.tex).

This is a real issue to me, since my co-author Feng Zhu started to manage all his references in one big file. Of course it is relatively small to carry this file around, however, when I have multiple collaborators, this will be a serious issue. I can not just copy all the references to another co-author, and if all people are doing the same thing, the reference bibtex file would be so large and extremely hard to keep in-sync among collaborators.

So I wrote the following program in PERL. Here is the introduction from the file:

FLIE: EXTRACTBIB.PLaa.gif
(Rename the file to extractbib.pl after downloading)

Version: 1.0

Description:
This program traverses all citations in one latex file (e.g. latexfile.tex), then go to a big bibtex file (e.g. references.bib) and extract only those papers that appear in the latex file, and outputs a new bibtex file (e.g. latexfile.bib) with the subset of papers that appear in the tex file.

One way to use it is to manage all the references in one big file (online, or offline), when a paper is finished, the author can run this program to get a small bibtex file so that this small file can be sent to a journal.

I guess this is often needed, however, I have not found a good solution so far. So here is mine. It is fairly complicated to address different cases. I’ll try to update it when I find a need. If you have any suggestions, please let me know.

Xiaoquan (Michael) Zhang
Assistant Professor, Hong Kong University of Science and Technology
July 04, 2007

zhangxiaoquan (a) gmail.com

Usage: perl extractbib.pl latexfile.tex references.bib [output.bib]
latexfile.tex is the original tex file
references.bib is the bibtex file containing all the references
output.bib contains the subset of references appear in the tex file
(If the output filename “output.bib” is omitted, the program will
generate a bibtex file with name: latexfile.tex)

Download the file (extractbib.pl) Here…
(Rename the file to extractbib.pl after downloading)

P.S.

After posting this, I thought about some ideas to improve this.

  1. The easiest way is to implement a web interface for this program. I can do two possible things:
    1. post two “text areas” for people to copy and paste latex article and the bibtex file. I can return the result to a new text box.
    2. post two tabs for people to “Browse” and upload the files, and return the result to a text box as well as to a link to the bibtex file.
  2. Feng Zhu suggested writing a macro for WinEDT. I can foresee this to be very popular, but I don’t have time for that. Besides, I’m not a big fan of WinEDT. I use Bakoma and LyX more often.

Austin posted the following program that extracts bibtex entries from the aux file. (bibsubset.pl)

Install a New Document Class to Bakoma LaTeX

Tuesday, May 29th, 2007 -- By ET
  1. Download the file xxxx.cls, xxxx.sty.
  2. Copy the style and class files to the folder ‘\LOCAL\TeX\LaTeX’ of the BaKoMa TeX installation directory. (normally this would be under C:\BaKoMa.TeX\LOCAL\TeX\LaTeX).
  3. If there are template files, copy the template file ‘xxxx_template.tex’ to the folder ‘\BaKoMa\Template\Dir\User’ of the BaKoMa TeX installation directory (C:\BaKoMa.TeX\BaKoMa\Template\Dir\User).
  4. Copy the file ‘xxxx_template.lcd’ to the folder ‘\BaKoMa\Template\Class’ of the BaKoMa TeX installation directory (C:\BaKoMa.TeX\BaKoMa\Template\Class). This file usually defines the customizable document properties of the template.
  5. Now rebuild the folder structure. Open the CENTAUR Text Editor or BaKoMa TeX Word and choose from the menu ‘Options/Directories’. Select the entry ‘$TEXMFLOCAL…’ from the list and click on ‘(Re)Build ls-R’. Close this window.
  6. The template is now successfully installed. To apply this template for a document, you have to create a new document in BaKoMa TeX Word and choose the template from the list ‘User/xxxx_template’. After clicking on ‘open’ you can customize the specific document options you prefer for your document.

Congestion Pricing, Part II

Thursday, May 10th, 2007 -- By ET

I wrote about the congestion pricing yesterday, and here are some follow-on thoughts.

In a paper published by Barro and Romer in 1987 (American Economic Review) they actually developed a model to discuss this problem:

ski.jpg

The intuition of the paper is that queues may have an effect on the allocation of resources that has nothing to do with the cost of time, and queues help to achieve an efficient allocation of the resources.

In the case of per-ride pricing, in equilibrium, the total capacity of rides, Jx[/tex] equals the total number demanded qN[/tex], that is

 Jx=D(P)\cdot F_{s}\left(\phi [D(P)]-PD(P)\right)=D(P)\cdot N(P,s)[/tex]</p>
<p>In the case of fixed-fee pricing, equilibrium condition for people to be indifferent between areas is</p>
<p>\phi (q_j)-\pi_{j} =\phi(q_k)-\pi_{k}.[/tex]

Differentiating, and noticing \phi^{'}(x/n_j)=D^{-1}(x/n_j),[/tex] (by <a href=Leibnitz’s formula) we can get

” />\frac{dn_j}{d\pi_j}\cdot \frac{\pi_j}{n_j}=-\frac{\pi_j}{D^{-1}(x/n_j)\cdot (x/n_j)}[/tex]

Maximization of revenue requires the elasticity of n_j[/tex] with respect to \pi_j[/tex] to be -1, so in equilibrium \frac{\pi_j}{q_j}=D^{-1} (q_j)[/tex]. Define the left hand side to be the effective price per ride \hat {P_j}[/tex], the condition for equilibrium in the areas is still

$$ Jx=D(\hat{P})\cdot N(\hat{P},s)[/tex]

Compare this with the previous one, we know both types of pricing reach the efficient allocation of the resource.

There can be structural operational cost differences between the two types of pricing. So which type is selected also depends on the operational costs. This congestion pricing (pay per use) in NYC is probably enabled by new technology.

The reduction in costs of monitoring and charging the pay-per-use fee is probably the determining factor in Bloomberg’s selection of this pricing scheme. In the NYT article, it was mentioned that the payment will be made by prepaid cards, etc. Actually, in my last ISMT101 class some students presented possibilities to use RFID to charge tolls in these situations. Compared with the huge loss in value of congestion, the price of RFID tags is negligible.

Yet another story about successfully using new tech to solve efficiency issues. When can people realize that this is only a tip of the iceberg of unlimited uses of IT to improve our lives? Or in Google’s lingo: “the world will be a little bit better place for everyone of us.”


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2007. All rights reserved.
All trademarks property of their owners.