Tide-you-over post

By stephen | September 14, 2008

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Here are the posts that I will write this week:

  • report of my Peru trip
  • itinerary of my upcoming NYC trip
  • blogs I have been reading
  • grad school prep advice
  • talk cryptically about my research (and related paper(s))

But, until then, here are some good links to tide you over till later today, when I get started working through the list.

Expect a Peru post later today.

Topics: Uncategorized | No Comments »

places I would like to live

By stephen | August 25, 2008

Life is for living, and there are many places that would be fun to live. Big cities, nice suburbs, small towns. Each of them have their own merits and problems. Currently, I live in Seattle. I like that it is a decent sized city, and there is a lot of uniqueness and character to the city. The food is great, with the focus on organic and other high quality foods. Riding your bike on the Burke-Gilman trail, buying some fresh salmon from the Pike Place Market and cooking it on the grill, all on a nice clear day, is the epitome of Seattle summers. And, of course, I love the University of Washington.

Despite all of what Seattle has to offer, I don’t plan on staying here forever. Here are some of the places where I would like to live, in no particular order.

  • NYC - I love this place. Everything you could ever want to do, you can do it there. Entertainment, food, art, etc. are all available at the highest echelons of quality. Rated as #3 trading city by Trader magazine (behind Chicago and London), it is a place that I would like to live for at least some period of time. This will probably happen while I am either single or with a young family.
  • New Canaan, CT - For suburbs, New Canaan is about as good as it gets. It is a 50 minute train ride from NYC on Metro North, so the commute would be very easy. I would not like to live in a situation where I was driving for 50 minutes to and from work. But, a train ride is completely different. It would be nice to have 50 minutes to unwind after work by reading or meditating. And, as an alternative to commuting to NYC, there are quite a few hedge funds in Greenwich, CT, which is only 25 minutes away, so working there is an option as well. The houses in New Canaan are typically large, with attention paid to well nice landscaping and classic architecture. What really sells New Canaan to me is their emphasis on high quality education. If I had a family and was working in NYC, living in New Canaan would be a good way to go.
  • London - this needs no commentary. London is incredible. Hands down.
  • Sao Paulo - I would love to live in Brazil at some point, and Sao Paulo would be the city of choice. It is huge, with nearly 20 million people in the Sao Paulo metro area. I love Brazilian food, big cities, and adventure. Living in the center of South America, I would certainly be well poised for quick trips to Copacabana Beach, Patagonia, Peru, Ecquador, etc. There are American schools there, so it would be possible to have a family there. And, I love hearing Portuguese.
  • Washington D.C. - my hometown. I was born in D.C. itself, and have tons of family there. There are people there of every ethnicity and background. There is always something interesting going on. I love exploring the city, seeing the many embassies and monuments. Whenever I am in D.C., I always end up at the Smithsonian Air and Space museum. As a kid, I always dreamed of being an astronaut and often went to the museum to look at the rockets, see an IMAX movie about space exploration, and maybe sample some freeze-dried astronaut ice cream.
  • Hong Kong - Seeing the skyline of Hong Kong should be reason enough to want to go there. It would be fun to be immersed in the Asian culture for a while.
    It has been rated as the world’s most beautiful skyline (image from wikipedia).
    HK
  • Tokyo - I have always wanted to experience Japanese culture. I think it would be difficult to move there to work, as they are not known for letting in giving work visa’s to foreign nations. However, if the opportunity arises to live there for some period of time, I would seriously consider it.
  • Working over satellite internet while on a sailing yacht - I currently have decent sailing skills.  It is one of my favorite hobbies. Exploring the Caribbean, crossing the pond, and skipping from town to town in the Mediterranean. I will do this at some point.
  • Urubamba Province - Sacred Valley, Cusco - The Sacred Valley of the Incas is one of the most peaceful places on Earth. If you need a place to relax and live a more simple life for a while, this is the place to go. And, with the construction of Cusco International Airport, it is reasonable to have a job that requires some travel, and still be based out of Cusco.

I will accomplish all of this. It will be great.

Topics: General | 3 Comments »

the newest addition to my feed reader

By stephen | August 21, 2008

It is a rare event that I read a blog from someone less than half my age. But, the blog of Thomas Boudreaux has got me intrigued. Economics, Star Trek, science! Sounds like a winning combination. I am quite impressed with this young man and I am looking forward to updates.

Also, Thomas is the son of Don Bordreaux, of Cafe Hayek. The name comes from Fredrich Hayek, of the Austrian school of economics. He authored the classic book The Road to Serfdom. I just ordered a copy.

Topics: General | No Comments »

curiosity and where Star Trek may have got it wrong

By stephen | August 11, 2008

I love the movie Star Trek IV, the Voyage Home. In this movie, there is a brief exchange between McCoy and Spock that goes as follows:

M: You present the appearance of a man with a problem
S: Your perception is correct, Doctor. In order to return us to the exact moment we left the 23rd century, I have used our journey back through time as a reference, calculating the coefficient of elapsed time in relation to the acceleration curve.
M: Naturally. So, what’s your problem.
S: Acceleration is no longer a constant.
M: Well then, you’re just going to have to take your best shot…

In this exchange, it reads as if discussing the physics of time travel comes naturally to people in the 23rd century. However, I would think that no matter how advanced our civilization becomes, there will be many intellectual minimalists who will: A- not know and B- not care about the workings of the world around them, despite what science has to say about it.

That is what leads me to say that curiosity is one of my favorite emotions/mental states. Curiosity is why kids take their toys apart and try to put them back together. Curiosity is the beginning of research, which eventually leads to understanding of some aspect of the real world. Curiosity is why people tinker, learn, understand, and contribute.

I think that curious people have a healthy discomfort with ignorance. On the other hand, there are many who perceive the world as a series of black boxes - cause in, effect out. What happens inside is indistinguishable from magic.

blackbox, from wikipedia

Blackbox, from wikipedia.

I love curiosity because it often leads to content creation. As anyone who reads blogs understands, the quality of a blog is a function of its content, much more than it is a function of design, layout, fonts, etc. Content creation is what drives the development of society. Journalists take as raw input the status of the world around them, and produce a concise summary with a certain perspective. Chefs take raw ingredients and produce high quality meals. It is all about adding value to more simple sources.

In my fields, finance, economics, and math, research adds value by expanding the intellectual toolbox of the community. Leibniz and Newton gave society differential and integral calculus. Henri Lebesgue, inventor of Lebesgue integration theory, did not know the future uses of his technique. It would be impossible to quanitfy the value of these tools to the world today. As each individual persues the obtaining of new knowledge in a specific field, the general body of knowledge expands, and humanity benefits. It is all about content. It is all about adding value.

Topics: General | 2 Comments »

lazy English

By stephen | August 9, 2008

I am going to try to feature some of the other blogs I read, not necessarily economic. One of the newer ones on my blog radar is gyre&gimble. It is mostly about math but features some other interesting tidbits as well. One of them is this post on the evolution of the English language, particularly, of unvoicing final consonant.

 Younger people frequently devoice final d while keeping the length of the vowel, so for example “road” ends with a t sound. The word does not become homophonic with “rote” because the latter has a shorter vowel, shorter in the time it takes to pronounce it (”long” and “short” are often used to denote vowel quality but I am not talking about that here.)

Interesting. I have noticed that people are using relaxing the ‘o’ sound in “for” to a u sound, like fur. As in, thank you fur the meal. I am going to make an effort to not do that, as it is not correct. For and four are homophones, not for and fur.

Topics: Uncategorized | No Comments »

modeling

By stephen | August 8, 2008

from the Sartorialist

This past spring, I took a modeling class. No, I was not learning how to pose in front of a camera (although I tried to convince some friends that that was indeed the case). Rather, I was doing another kind of modeling. Modeling with differential equations. The class was taught by Professor Ka-Kit Tung, and it was a great class. It was a lot of systems of differential equations used to represent physical, biological, and other phenomena. I wrote a paper on the Black and Scholes model for that class, and it came out very nicely. Professor Tung wrote the book that the class used, called Topics in Mathematical Modeling. It is a great book. In it, Professor Tung thoroughly explains the reasoning behind the devlopment of each model. It is the kind of book that you could use for a class, but also enjoy reading recreationally, sitting on your porch on a Sunday afternoon, sipping a cool beverage while your dog chases rabbits through the garden.

Lately, I have been trying to read some papers that have to do with modeling. It is easy to find these papers. Just look up the Journal of Financial and Quantitative Analysis and do a search for articles with the word ‘model’ in the title. These are the ones I am working on reading:

I would post the PDF’s for your reading pleasure, but that would get me in trouble. I’m sure that anyone who is interested in these articles will know how to find them. I am also trying to work through some of the classics. On my list (and my night table) is Vasicek’s Equilibrium Characterization of the Term Structure. Plus, I do mathematical modeling for work as well.

In conclusion, modeling is on my mind.

The picture is taken from The Sartorialist, which is an excellent fashion blog which I would admit to reading. It was recommended to me by my friend Wendy. Thanks!

Topics: General, Mathematical Economics, Academic Journals and Papers | No Comments »

nerdular nerdence

By stephen | July 30, 2008

So I have a great idea. Additionally, it is a very nerdy idea - something that could be in nerdular nerdence magazine. I have been playing quite a bit of Settler’s of Catan lately. It is a great game, and I thoroughly enjoy playing it. The game involves resource acquisition and trade. The game board consists of tiles that represent different resources - either ore (not either/or - that is a book by Kierkegaard about existentialism), wheat, brick,sheep, and wood. There are 2-4 players (up to 6 with the expansion). Each player has control of settlements, cities, and roads. Initially, each player is allowed to place settlements at 2 intersections, and 1 road leading from each settlement. (the pieces are hexagonal, so 3 pieces form a corner.) Each piece is then randomly numbered 2 through 12.

The board:

The game play is as follows:

  • The player rolls a die to initiate their turn. All players collect a resource card for each settlement (or 2 for each city) if they are built on a resource piece that is marked with the respective number
  • Players may purchase more roads, settlements, upgrade settlements to cities (which collect 2 resources per turn), purchase development cards,trade resources with others, trade 4 cards of a kind for 1 card of their choosing or do nothing.
  • Development cards are drawn randomly from a deck, and are not shown to any other player. Development cards can be victory points, soldier cards, and other cards that give you advantages in trade
  • There are also ports on the outskirts of the board. There are 2 types of ports. Generic 3-1 and specific 2-1. Generic 3-1 lets you trade 3 of any card for 1 card of your choice. Specific 2-1 lets you trade 2 of a specified card for any card of your choice.
  • If a 7 is rolled, you may keep ceiling of (# of cards in hand / 2) if you have 7 or more cards. If you have 7 or 8 cards, a 7 rolled reduces your hand to 4, etc. The discarded cards are put back in the pile. When a player moves a
  • The die are passed to the next player

A player wins by collecting 10 points.

  • Settlement = 1 point
  • City = 2 points
  • Longest road = 2 points
  • Largest army = 2 points (earned by playing 3 soldier cards before anyone else)

That is Settlers in a nutshell. Here is my idea. It would be interesting to compete with others to design systematic Settlers playing algorithms. To facilitate that, I have an idea for a web service that I could make. It would be a web service that will give you the state of the board and the hands of every player at every turn (this information is knowable in real game play, since all trades are visible).

Each person who wanted to play this game algorithmically would need to design a few of their own functions:

  • Placement function - how to place your pieces in the beginning of the game
  • Turn function - given all known information (state of board, hand of all players), execute a turn. This will have to take care of building, proposing trades to others, purchasing development cards. It will certainly be the most complicated to write
  • Trade function- given all known information, if you are offered a trade, what is your response.

There could be some rules imposed, just to prevent infinite loops. For example, each player can only propose 4 trades with each other player during their turn (this should exhaust trading possibilities anyway). Then, the game play would take place in the form of Monte Carlo simulation tournaments. 2 algorithms could compete over 50,000 games and see which algorithm wins, on average. For practice, there could be a computer player who essentially plays randomly, just obeying the game rules. Or, there could be a continuous simulation always running, and as people update their algorithms, they can possibly rise in the rankings. Perhaps if I have a sleepless night sometime this week or next, I’ll write up a couple of XSD’s. There shouldn’t be a lot of coding involved. The server will need to validate the moves and maintain the state of the board.The serer will also need to make sure that all players have seen the board and acknowledged this fact before the start of the next. So, there will have to be a protocol developed. I think that this would be an incredibly fun exercise in programming and in algorithmic game playing.

Anyone up for playing Monte Carlo Settlers with perl scripts?

Topics: Uncategorized | 1 Comment »

Father’s Day

By stephen | June 15, 2008

It is time for a great blog post, and, being that it is father’s day, I have the perfect topic. I wanted to write this post to thank my dad, Jeff Barr, for being a great father. Being his son and part of the family is a blast, and there are many reasons why. For example, most people my age joke about the technical incompetence of their parents, or their lace of ability to send an email or text message. I have the opposite problem. I struggle to stay maintain 25% of the competency that my dad has regarding technology, and life in general. My dad is the kind of person that can talk to an expert in ANY discipline - computer science, astronomy, finance, economics, manufacturing…anything except sports…., and meaningfully participate as an equal.

Additionally, my dad is always doing something interesting. I have never seen him watch TV by himself. If a family member is watching, he’ll sit down to keep them company for a while, but he never vegetates (his term for TV watching and other forms of passive entertainment)This attitude has given everyone in the family the work ethic needed to accomplish great things. If you think you can keep up with him at a conference or business trip, think again. There are few that can.

I am at the point in my life where the professional interests of myself and my dad are thoroughly intertwined and it is fun to have him involved in my academic life. Most recently, he and another guy, Yair,  both from Amazon Web Services, were able to attend a meeting with myself and some finance professors at the UW to discuss Amazon’s role in the research we have been doing. It would have been a great meeting even if the AWS people were strangers, but having one of them be my dad made it that much better.

Dad, Happy Father’s Day!

Topics: General | No Comments »

distributed matlab (part 1 of 3) - compiling

By stephen | May 7, 2008

This is part one of a three part series on writing distributed applications with matlab. My particular interest is the analysis of financial data, but a knowledge of developing distributed matlab applications should be of use to people in any field where processing a large amount of information is critical, and matlab is your tool of choice.

There are several different ways to go about distributed computing with Matlab. Given your matlab m file, foo.m, you could

I prefer the third option, because I can then run my app on a Hadoop cluster running on EC2. Yeah, it’s awesome.

The first step in this process can be a bit cumbersome. Here are the issues that I came accross.

Suppose you had some m file, foo.m:

function g = foo()
% the “Squibonacci” function from the compiler documentation
n = 1000;
g = zeros(1,n)
g(1) = 1;
g(2) = 1;
for i=3:n
g(i) = sqrt(g(i-1)) + g(i-2);
end

The first step is to setup your Matlab compiler by running the Matlab command: mbuild -setup
Be sure to consult your documentation if something strange appears. Importantly, on Unix, this creates a file in your home directory called mbuildopts.sh. This controls to parameters that Matlab can use to compile and link the C files that you generate from the M-files. The file is located in ~/.matlab/R14/mbuildopts.sh.

At this point, try compiling foo.m.
>> mcc -m foo.m

If you are successful, this should have generated some files in the same directory, namely  foo_main.c, foo.ctf, foo_mcr, foo_mcc_component_data.c. The first time I did this, I ran into an error.

Warning: Duplicate directory name: /usr/local/matlabR14/toolbox/local.
/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/local/matlabR14/bin/glnx86/libmwmclmcrrt.so, may conflict with libstdc++.so.6

The problem was that my default g++ compiler is version 3.4.6, and I needed to be using 3.2.3, such that I would link to libstdc++.so.5, rather than so.6. Luckily, my machine also had a copy of g++ 3.2.3 installed, named g++32. *NOTE - you can check your version of g++ by running g++ - version* To point Matlab at the correct g++, I modified mbuildopts.sh, replacing gcc with gcc32 in the appropriate section. This fixed the problem. (Note, you may need to dig up and install 3.2.3 if it is not on your system. There is some care needed to have multiple versions of gcc installed on the same computer. Make sure to look into this.)

After running mcc, it is time to run mbuild. Issue the command:

>> mbuild foo_main.c foo_mcc_component_data.c -g -output foo.x

This will compile a standalone executable called foo.x. Try to run it by going to a shell and doing ./foo.x.  This should produce the same output that would have been produced by running foo.m within Matlab. However, this is its own standalone application and can be run on systems without Matlab installed.  And, importantly for Hadoop streaming, you can control input and output to foo.x by redirecting STDIN and STDOUT.

Another possible pitfall is that, when running foo.x, you get the following error:

bash-3.00$ ./foo.x
./foo.x: error while loading shared libraries: libmwmclmcrrt.so.7.2: cannot open shared object file: No such file or directory

In this case, there is a problem with your  LD_LIBRARY_PATH environment variable. You can fix this by editing your ~/.bashrc file and adding these lines (these paths are correct for my box. They should be somewhat similar for other systems, at least those running Red Hat):

export MATLAB=/usr/local/matlabR14
export LD_LIBRARY_PATH=$MATLAB/bin/glnx86
export LD_LIBRARY_PATH=$MATLAB/extern/lib/glnx86:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/matlabR14/sys/os/glnx86:$LD_LIBRARY_PATH

At this point, you should be able to compile Matlab applications and be able to run them on the command line. Check back for part 2 of 3, packaging and distributing standalone matlab applications for running on Hadoop notes.

-steve

Topics: Economists' Toolbox | 1 Comment »

economics of suburbia and the transportation problem

By stephen | March 31, 2008

 00108.jpg

These are tickets from my recent trip to the East Coast. One thing I enjoyed there was the public transportation system. I really enjoyed being able to go anywhere in Manhattan with ease and for a low cost (a subway ride is $2, an all day pass is $7.50). From New York, I was able to go to DC for a few days to visit my relatives. This was also easy and inexpensive ($70 - $120 for an Amtrak ticket). Amtrak trains are great. You get on the train just a few minutes before it boards, and you get to read or work on your laptop while you go quickly and reliably to your destination. There are 120V AC power outlets available, so battery life isn’t an issue. If I had mobile broadband, I would even have been able to do some of my internet-based work. The point is, efficient and reliable public transportation is a great amenity of well developed cities and states.

It will also be a solution to the mess we have created for ourselves in terms of suburban sprawl. This mess has roots in economics. For a long time, it was relatively inexpensive for each person to have their own acre of land and large house. Government road development projects, combined with a postal service with universal service obligations (the guarantee that each person has the right to have mail delivered to them) made it easy for suburbia to develop.

The rising costs of energy are changing the costs of the suburban lifestyle to which Americans have grown accustomed.  This NPR broadcast/article talks about how in Atlanta, the average commute is a 66 mile round trip. That is crazy. As energy costs rise, the opportunity costs of living in the suburbs will increase, and people will begin to re-urbanize in order to save money. Also, shared parks, water heaters, air conditioning units, and transportation systems allow for the economies of scale to function, reducing energy costs.

From one point of view, it is good that energy is expensive and the expectation is that prices will continue to rise. This is because it will force innovation that will ultimately be for the greater good.  An example would be hybrid cars. As energy costs rise, it becomes more cost effective to research these technologies. The propagation of this technology has allowed for more energy efficiency, and as a side benefit, cleaner air. If gas was still $1/gal, we would still be driving around SUV’s and pickup trucks, just for the fun of it.

In a few years, I imagine that it will be too expensive for most people to live in such a way that they drive a 6000 lb vehicle 66 miles per day. And even if they could afford it, it seems wasteful. I look forward to seeing the innovations that will come as we are forced to live under these changing economic conditions. Wouldn’t it be nice to have cities with nice parks, with people using either mass transit or electric vehicles** to get to and from work. That would give the urban amenities (nice communities, stores and restaurants in walking distance, lots of people to talk to) without the pollution. That would be nice.

Take care!

~~~~

**the idea that electric cars help the environment is based on the assumption that the energy is coming from a clean source. If we use coal or oil burning power plants to generate the electricity to run the cars, we haven’t really solved the problem. Personally, I think that the answer, at least in the short and medium term, is nuclear power. It is reliable, clean, extremely efficient, and it is a well developed technology. Unfortunately, as Howard Dean taught us, one slip up can tarnish an otherwise decent track-record. I think it is time that, as a culture, we took another look at nuclear power.

Topics: General | 2 Comments »

« Previous Entries