Happy Father’s Day

By stephen | June 20, 2010

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

Fathers day blog postIt has because a tradition for me to write a father’s day blog post. Today I wanted to start with a fun story. A few years ago, my dad was doing some errands in the kitchen. One of his errands was to fill the soap dispensers built into the sink. There were two dispensers. My dad took a one gallon container of soap, removed the dispenser heads, and started filling the soap. He must have thought that the soap container under the sink was incredibly large. After emptying the majority of the soap into the sink soap started pouring out from the sink cabinet. It turned out that one of the soap dispenser heads had no underlying bottle and my dad had emptied an entire gallon of soap into the kitchen cabinet. Hillarity ensued and we found that soap is actually difficult to clean.My dad is a wonderful man, and happily bears the responsibility of a family. He is more generous than anyone else I have ever known. He is a fantastic father and I am very proud to be his son.Happy father’s day!

Topics: Uncategorized | No Comments »

economics via post-its

By stephen | March 13, 2010

From marginal revolutionI like this. Economics 101 reduces to this.Related simple reductions of complicated classes:

  • John Long’s first price theory class can be reduced to: “If it was better for the agent to have made choice B than choice A, the agent would have chosen choice B in the first place. The fact that they didn’t means that it wasn’t their best choice.”
  • John Long’s discrete time finance: No profit opportunities implies there exists a pricing kernel and the law of one price holds.John Long’s continuous time finance: No profit opportunities implies there exists a pricing kernel process, a couple of martingales, and the law of one price still holds. Sometimes change to risk neutral measure to make things easy. Make sure to change back at some point, because in real life people aren’t risk neutral. Also, bonds do certain things under certain assumptions under certain measures….” Okay, cts time finance isn’t easy to summarize.
  • Game theory: everyone maximizes their utility based on all available information based on everything they could possibly know at the time they make their decision.
  • Nonlinear optimization: take the derivative, set it equal to zero, check some conditions. Convexity is really important.
  • Econometrics: Beta = (X’X)^(-1) (X’Y) essentially. Sometimes there are problems with the structure of the data and how it makes the error terms behave, so tweak how you calculate beta to fix it. Once your residual is white noise, you are probably in good shape. Check out of sample forecasts and make sure.

Topics: General, News, Mathematical Economics | No Comments »

Undergrad memories - Boy Scout Meal Planning

By stephen | March 13, 2010

I was thinking about a project I did as an undergrad for a mathematical modeling course I took at the University of Washington. The idea was to make a linear program that would optimize supplies that boy scouts or other backpackers could take on hikes. However, I worry that this project never really helped anybody, so I decided to put the main result online for all to see.The idea is that backpackers are facing 2 constraints when deciding what food to bring. Weight and cost. The parameters of the tradeoff depend on the situation. For a weekend camping with a 2 mile hike in, might as well stick a 5 lb piece of beef on your backpack, wrapped in ice. Whereas, for a 2 week trip on the Pacific Crest Trail, you want to prioritize nutrient density, and you would probably be willing to pay a bit extra to save some weight.So, your “objective function” is thenmin weight + alpha * costwhere alpha is a parameter that increases as your desire to trade weight for cost increases. In the paper, we used a hand-collected data set of typical foods that campers would bring, and showed how as alpha increased, the menu changed. The constraints on this menu are that it meets protein and calorie requirements for an average sized hiker, who is expending an above average amount of calories. (in the paper, there is an “exertion factor”, where 1 is a normal day, 2 is expending twice the amount of calories in a normal day, etc.)On to the results:mealPlan I believe that this was a plan for 5 days. See how as alpha increases, the plan calls for less heavy and cheap stuff, such as hot dog and hamburger, and starts to substitute expensive things such as Backpacker’s pantry juevos rancheros egg mix. At the highest level of alpha, the backpacker is advised to use mostly pre-packaged mountain house and backpackers pantry meals. As any outdoor enthusiast knows, these are expensive. Alpha shows  that these only get used when you really care more about weight than cost.Anyway, the entire paper is attached here. Remember, I was much less experienced at the time, so it is a bit ugly by my current standards. Spring break is coming up, and I want to take a few hours and put the program online with customizable parameters so that people can use this to help plan their trips. math paper. I’ll also post the code and data set so people modify this for their own needs. I feel bad that this project hasn’t really helped anybody as of yet, so this is my penance.DISCLAIMER: These are only suggestions. If you run out of food on your trip, not my fault!

Topics: nostalgia | 1 Comment »

Shostakovich: Symphony no. 5, performed by Eastman Philharmonia

By stephen | October 13, 2009

Last Friday night, I had the privilege of attending a concert at the newly opened Kodak Hall. The final piece performed was Symphony No. 5 by Shostakovich. I was strongly captivated by that piece. More so than any other piece in recent memory. The program notes provided an interesting introduction to the piece. Shostakovich worked in the early Soviet republic, under Stalin. He wrote pieces that were a bit edgy for his day, and received harsh criticism in a Pravda article.

He later wrote the 5th symphony, which was more socially acceptable. He wanted to make is music reflect optimism and happiness in the Soviet Union, but later in life described the tone of the piece as “The rejoicing is forced, created under threat…It’s as if someone were beating you with a stick and saying ‘Your business is rejoicing, your business is rejoicing,’ and you rise, shaky, and go marching off, muttering, ‘our business is rejoicing, our business is rejoicing’.” Having read this, I listened intently to the piece.

Rochester is a small town, and I am glad I have access to concerts at the Eastman School for a source of solace in music.

Topics: General, News | No Comments »

Story Time!

By stephen | September 19, 2009

 24hr-cover.jpg

Greetings, earthlings. I try to go running several times a week. I just acquired an iPod touch, and while running I listen to podcasts. I have been thoroughly enjoying EscapePod, a pod cast of short science fiction. Last night / early this morning, I listened to Mr. Penumbra’s Twenty-Four-Hour Book Store. That was the most fascinating story I have heard in a long time. The story originally appeared on Robin Sloan’s blog. I won’t give away the story, but here are some quotes early in the story that grabbed my attention

I’d souped it up so it could show you not just where the books were located, but which were sold, and to whom. They lit up like little lamps in the blocky 3D shelves. They’re color-coded, so the books purchased by Mr. Tyndall lit up blue, Mr. Raleigh’s were green, Fedorov was yellow, Imbert orange, and so on.

But now the shelves were disappearing when I rotated them too far. So I was sitting there, trying to figure out why, when a voice piped up from over my shoulder:

“Are you into data visualization?”

….

But Kat (her name was Kat) thought it was cute, and she was, in fact, a genius. She tracked down the bug and fixed it in the time it took me to drain my mug. And then, tap-tap, she made the shelves render more realistically, with a cool sort of wood-grain texture.

Then she said, “Have you thought about doing a time-series visualization?”

This sounded like a nerd’s way of asking another nerd out on a date, so I said I hadn’t, but that I was super interested. We made plans to meet at Supply and Demand the next day.

If you don’t know why this would interest me, you don’t know me. I loved the story because it is set in the immediate present, and incorporates many aspects of our day into the story, but in a non-obnoxious manner.

I highly suggest you give it a listen. It has reminded me of my own short story I want to write….

Topics: General | 1 Comment »

Saturday morning links

By stephen | September 19, 2009

I decided to be like my Dad and post some links. I post more if you follow my Google feed. Several of the posts today are from Infrastructurist, which is a blog I quite enjoy.

Enjoy.

Topics: Uncategorized | No Comments »

this story sounds familiar

By stephen | September 17, 2009

From NYT a few days ago, Off With Its Top! City Cuts Tower to Size.

Says the article:

 Still, the notion of treating the Midtown skyline as a museum piece is more disturbing. The desire of each new generation of architects and builders to leave its mark on the city, to contribute its own forms, is essential to making New York what it is. The soaring height and slender silhouette of Mr. Nouvel’s tower not only captured the spirit of Midtown — the energy and hubris that transformed this island into a monument to American cosmopolitanism — it also brought that spirit forcefully into the present.

I wholeheartedly agree with this paragraph. I love Manhattan for many reasons, including the beauty and functionality that arises from a chaos of people, cultures, beliefs, with everyone finding their niche.

This story sounds quite familiar…

Topics: News | No Comments »

“United Breaks Guitars”, empowering the consumer, reducing information asymmetry

By stephen | August 19, 2009

I have been thinking about the power of reviews lately, specifically the power of internet based reviews and their importance in purchasing power. The contracts that I enter, over the internet, are almost entirely based on my trust in peer review. I was discussing this with my friend Rich, and he concurred. I won’t buy a book if it has several bad reviews. A recent example of this is my search for a guide book to hiking the Adirondacks (hooray for Labor day). One potential option was 50 Hikes in the Adirondacks, and another was Adirondack Trails: High Peaks Region. Initially, the  50 hikes book looked appealing, but 2 bad reviews gave me second thoughts. Both reviews stated that the instructions on how to actually get to the trailhead were quite vague. I don’t want to have trouble finding a trail head. So, I probably won’t risk getting the book. And it does not seem like the author has addressed the criticism (for example, by providing exact GPS Lat./Long. data, which seems like a reasonable request in 2009). I have not bought the other book either, but it is still an option. Contrast this to 15 years ago, where I would not have known this about the book without spending the time (and, therefore spending money) to find a copy of the book and read a fair bit of it before coming to the same conclusion. The internet has made me a more effective consumer.

Other great examples of consumer feedback are

  • United Breaks Guitars - Guitarist David Carroll pledged to make 3 videos about United Airlines after they broke his guitar and refused to pay back. The songs, which are hilarious, have millions of views. I know what song I will be humming as I book my next flight
    Video 2

    Video 1

  • RocWiki - Allows people to rate local businesses. One business had a long series of bad reviews. I will not be going there.
  • NewEgg - On NewEgg, an electronics seller, OEM’s (original equipment manufacturers) seem quite interested in the reviews given to their products. NewEgg allows manufacturers to respond to bad feedback, and many do. See examples from Asus and EVGA. In both cases, the OEM’s stated that they are willing to help resolve the technical issues that merited the bad review.
  • Ebay - who would buy something from someone with less than 95% positive? I would not.

Topics: General, Theory | No Comments »

some R to print a matrix in LaTeX

By stephen | July 9, 2009

Sometimes, it may be handy to print an R matrix as a LaTeX matrix. Sweave has code to print an R data structure as a table, but not as a nicely formatted LaTeX matrix. A little bit of coding yielded a function printLatexMatrix (download print LaTeX matrix). I gave the option to download the function, rather than paste it in the blog post, because there are some escape sequences that need to be exactly right and I down want wordpress to mangle them. If you look in the file, you can see a sequence that has “\\\\\\\\”. Yes, eight backslashes. This ends up as 2 backslashes in your .tex file, which is what you want. This is designed to be run as R -> Sweave -> LaTeX. Each layer essentially removes a few “\” characters. As it says on p.46 Patrick Burns’ R inferno, in R, backlashes grow in powers of two.

Thus, you can pass this function a matrix and it will make a nicely printed LaTeX matrix. Perhaps someone finds this useful.

Topics: Economists' Toolbox | 1 Comment »

U of R and I

By stephen | July 8, 2009

I have been at the University of Rochester for a few days now, and I love it. The area is very nice, the folks in my program are great, and the area itself is quite nice. Being originally from Washington DC, I enjoy humid summers.

Tonight, some of the Ph.D. students, myself included, went to Hedges Restaurant to celebrate the end of one academic year and to meet one another.  They are right on the shores of Lake Ontario, and it after dinner we walked out on the peer, took some photos (pictures forthcoming), and watched the sun set on the lake. And now, after the blog post, I have some studying to do.

Yesterday and today, I have also been working on a little perl/MySQL solution to catalog my thoughts on various books/papers that I have read. Essentially, the tool keeps a database of articles/books/other resources that I use, tagged by keywords. Each article is linked to a chunk of LaTeX (actually, it will be Sweave code, which is LaTeX with embedded R) that I would write, which contains my thoughts on the subject. Using LaTeX/R, I can write equations and have  implementations in R embedded in the document.

The usage will be as follows

  1. I come accross a paper about….microstructure and exchange rates. Thus, I tag it with both microstructure and exchange_rates
  2. After reading the article, gaining some useful insights, I would tell the program to edit thoughts on that article. The program automatically fires up my favorite text editor, handing it the correct file, where I can edit my thoughts, complete with LaTeX equations and embedded R code.
  3. Later, when preparing to write a paper or think about the bigger picture of my thoughts, I would want to review all of my notes on a topic. Sticking with microstructure and exchange_rates, I could tell my program to generate a report of all of my thoughts on those subjects. It would then query the DB for all articles, books, etc. that are tagged with those keywords, and compile into one document, render it, and hand me back a PDF. The pdf would be organized as Paper 1
    Thoughts on paper 1.
    Paper 2
    Thoughts on paper 2….

    etc.

I would say I have about 6 hours left on this application, and then I will release it on the blog.  Look forward to this by tomorrow evening.

Topics: General | No Comments »

« Previous Entries