Random Walks

February 8, 2008 by sfingram

I’ve been studying finance lately and one concept that keeps popping up is the notion of a random walk. In finance, random walks are used in modeling how prices evolve over time. In the discrete random walk model, an asset price can either go up or down a random amount after a unit of time. Here is a picture of a random walk

rwalk1.png

The start of the walk is on the left and the path, very random looking, continues all the way to the right indefinitely. Every pixel in the x direction is a time step. Here is a picture with a few random walks superimposed on each other.

rwalk2.png

You’ll notice that a pattern is starting to emerge.  To better see the pattern, I lowered the transparency of the random walks and ran several thousand of them to get the following image:

rwalk3.png

Random walks are related to diffusion.  In this picture, the relationship between the two is very obvious.  The idea is that the path of a particle of smoke in air or ink in water is very similar to a random walk over time.  The position of a particle (or price) at a given time can be modeled by a normal distribution whose variance evolves in a manner similar to the continuous of process of diffusion.  So the normal distribution gets flatter and flatter and this corresponds to the dilution of the particulate matter in the medium.

I just wanted to see it.

Pericles

January 11, 2008 by sfingram

We went down to Atlanta for the break and had a much needed good time.  I spent time with old friends and family.  Old haunts were visited.  Much fun was had.

Every time I revisit Atlanta, which I still think of as home, it makes me a nostalgic and melancholy.  Compared to Vancouver it is dirty, unsafe, badly planned, poorly educated, politically conservative, and in the middle of a serious drought.  But it has a very unique character (outside of downtown).  And barbecue.  Cheap(er) real estate.  Sunlight in the Winter.  My family and best friends live there or near there.  It is older and larger than Vancouver and it has a more extensive rail system that is planning on getting better.  I miss it.

When we returned to our current home with its clouds and cold rain, I realized that I’ll probably end up feeling similarly about Vancouver.

Considerable loot was had this Christmas.  I received a Nintendo DS, which I was secretly desiring for well over a year.  I love classic video games, but it’s makes me feel old seeing all the kids on the bus using styluses to play games and I’ve been wanting to jump in.  Among other things I got a serious rain-coat.  Walking around Vancouver without a umbrella for the first time was liberating.  I may look like, as one friend put it, a yuppie hiker, but screw you guys, I am warm, comfortable and dry!

We also received some very good DVDs, two Miyazaki movies (kiki’s and howl’s) and Bambi.  It is interesting how Eleanor immediately gravitates toward these films.  She will go through periods of liking Disney or Pixar movies, but her interest is never held as it is with Miyazaki’s films.  The exception so far is Bambi.  Eleanor really responds to the young Bambi and the way he learns to walk and talk by listening to Thumper.  I haven’t watched Bambi since I was a toddler, and seeing it with new eyes was actually moving.  I can’t believe how good the character animation is.  On technical achievement alone, the film holds up as a masterpiece.  Quite a contrast to the gutless, schlock sequels that Disney is putting out these days.

Eleanor is different from when we left Vancouver.  Her exposure to her cousins always flips some internal switch in her personal development.  The baby Eleanor is truly gone.  She is a kid now.  She loves painting, books and movies and really likes just horsing around.  I knew every parent thinks and says this, but Kelsey and I got lucky with Eleanor.  She is wonderful.

I’ve kept up with the audio Japanese, but my kanji study has very seriously faultered.  My repertoire is currently exhibiting sub-logarithmic growth.  My goal for 2008 is to finish Heisig and so I need to get crackin on the remaining 1200 characters.  Another goal of mine is to watch something in Japanese w/o subtitles at best once a day, but at worst once a week.  I’m also interested in an SRS system for the Nintendo DS.  I think the best option is Khatzumemo, which can be accessed using the DS browser, however this isn’t too useful on the bus.

This semester is shaping up to be a lot of fun.  I return to research, after a diversion into thesis writing, which is always lots of fun and interesting.  I’m taking a class on dominant eigenvalue problems such as Google’s PageRank algorithm and expanders.   I’m also a teaching assistant for Computer Graphics for the third time.  Computer graphics is cool for so many reasons that I’m happy to have anything to do with it and I hope that doesn’t change.

I have a lot of reading lined up.  I’m currently reading Peloponnesian War by Donald Kagan.  I was always into Greek civilization as a child and I never really understood what specifically happened to them.  Reading this book is like going back and explaining to the thirteen year old still inside me what really went down.  Next on the list are Power Up and The Rest Is Just Noise.

Life is good.  Zero complaints.

Mastered

November 29, 2007 by sfingram

Well, I am now officially a master of something.  It will even be written on sheepskin or some high-quality medium.  The final presentation went well.  I remember falling into a sort of trance as a I rattled off the high-level description of the past year and a half of my life.  The “defense” part of the presentation was painless.  No scary questions or I don’t knows.  It’s over.   Now on to becoming a doctor of philosophy.

Currently no progress on Kanji.  I have been keeping up with practicing the characters I know, but I had so little time while finishing the Master’s that I couldn’t make further progress.  This changes this week as I will make it to 800 for sure.

Went to Kintaro downtown today.  Kintaro is a hand-made ramen place in Downtown Vancouver.  Most of the patrons are Japanese, lending it an authentic feel.  Compared to most North American Japanese food, this stuff is divine.  The gyozas alone were delicious, to say nothing of the rich miso and pork broth they serve.   Some say it is standard fare in Japan, but it is head and shoulders above anything I’ve experienced here.  I can’t wait to try some of the izakaya in the same area.

700 Kanji

November 13, 2007 by sfingram

Phew.  I made it to 700 Kanji yesterday.  My progress has assumed a logarithmic nature, but this is most likely due to present circumstances.  I submit my final thesis this week and next Friday is my final presentation.  In the meantime it’s been hard to find the time to learn new characters.

Less than two weeks of being a Master’s student left.

Imaginative memory is the key

November 4, 2007 by sfingram

In the course of Remembering the Kanji, Heisig refers to something he calls “imaginative memory.”  As opposed to verbal or visual memory, imaginative memory involves creativity and effort on the part of the learner.  For example, most of the things you learn in life are associated with some sort of learning experience.  For example, I can remember the entire experience of when I learned to tie my shoes.  I remember the way the sun was coming in through the sliding doors.  I remember the look of my old shoes.  I also remember the neighbor kid who thought it was fun to teach me to tie my shoes.  I don’t have to think very hard about this kind of thing because it has very powerful associations.

When you’re learning something by rote, you don’t have these kind of advantages.  You have only very weak associations in your mind.  Like I can’t remember most US state capitals, even though I learned them by rote on numerous occasions.  I used to know all the states of the USSR.  I learned them all usually in one sitting, and usually by conjuring up some kind of temporary and weak association like Montana=Helena (why?  who cares, just Montana = Helena ).
I didn’t really initially buy Heisig’s imaginative memory.  Or rather, I didn’t really buy that it was all that useful or better than visual memory.  I went along with it, but about a quarter of the way through the book, he stops giving you stories for each of the Kanji.  Instead he gives you the word to associate with the Kanji and asks that you invent your own story to memorize it.  Because I wasn’t really sold on Heisig’s technique, I didn’t bother with constructing any imaginative images to go with the new Kanji.  I just came up with trivial little stories that allowed me to memorize the new Kanji in a single sitting as fast as possible.

As a result, the next time I reviewed these new characters, I forgot them ALL.   Zero percent retention.  I couldn’t believe it.

I went back, re-learned the same kanji I missed, this time making vivid images for each little story.  Now I can very easily recall them all.  I am completely sold on this memorization technique.  My current kanji count is 650.

In other Japanese news, I am finished with Pimsleur’s Japanese I.  Tomorrow I will start Japanese II.

600 Kanji

October 27, 2007 by sfingram

kanji600-small.jpg

 

I’m finally over 600 kanji, meaning I have “only” 1400 more to go. The picture above is currently my trusty stack of completed kanji cards with a crayon for reference. It’s becoming more and more difficult for me to find time to make the cards, devise the little stories, memorize them, then work through them on the SRS. The other difficult thing of late is that, because I have so many thing in the SRS, it takes for-ever to get caught up on the ones that I’m scheduled to review.

Children’s Show TV Theme Songs

October 22, 2007 by sfingram

I’ve noticed something interesting about the theme songs of children’s TV shows these days: they are awesome. This was not the case with songs from when I was a child.  The only songs I can remember are from the Gummi bears and Duck Tales. Here are my current top three favorite kid show theme songs…

  1. Arthur, by Ziggy Marley.
  2. Franklin, by Bruce Cockburn.
  3. The Berenstain Bears, by Lee Ann Womack.

Now this doesn’t mean I like the shows.  The only one I actually enjoy is Arthur.  Hey, I am not ashamed to admit to looking forward to watching Arthur every morning!

500 Kanji / No Good Day

October 19, 2007 by sfingram

I’m at 500 Kanji. That’s 1/4 of the way done. I think I’m still coasting on initial momentum, but it’s fast running out. I surmise that at around 600, the bottom is going to drop out and I’m going to have to really start exercising my will to learn this language.

In other news, today officially sucks.  I overslept.  My meeting was a bust.  Didn’t get a paper into a workshop (it was a long-shot and tangential to my research).  Missed a group meeting.  Lost my ipod.  Standing room only on the bus.  Eleanor is sick and refused to nap for me.  My sink backed up (for some reason) and then the trap section of the pipe burst and tons of water shot out all over the kitchen floor.

 Man, I HATE days like today.

The Beauty of Random Folds

October 15, 2007 by sfingram

Much of my master’s work is about using GPUs in creative ways.  Since I can’t talk about most of that work because it is pending publication, I can talk about a fun project I did a few months ago.  I got the idea from looking at the work of Jonathan McCabe.  It seems he develops quite beautiful patterns based on folding an rectangular array of input points.  The site didn’t really give enough information to reproduce the images exactly, and most of the descriptions I’ve read by McCabe seem designed to obfuscate the process.  It sounds basically like tie-die, where you fold up your cloth, then based on where a point ends up when it is folded, you chose a color for that point and then unfold the thing and voila!  McCabe seems to be doing something a little extra where he interpolates the colors generated at previous folds, but no matter…

I thought that maybe instead of computing the color based on where a point ends up after being folded up, perhaps we can choose a color based on the final orientation of a point.  In other words if the input array of points were a set of vectors all pointing the same direction and then we randomly fold the sheet of paper 32 consecutive times, what is the terminal orientation of each vector?  We then render each point according to a simple lighting model where white is when the vector points toward the light (an angle of 0 degrees), dark gray is where the vector points away from the light (an angle of 180 degrees), and any other angle of the vector is just an interpolation between these color values.  The idea is that this is roughly what a piece of paper would look like if you could fold it 32 times where you choose a random position and orientation for each fold every time.

When I say “fold” a sheet of paper, I mean this:

  • draw a random line in the plane in which the paper lies
  • ensure the line intersects the sheet of paper
  • the line divides the plane in half so choose a random side of the line
  • reflect all the points on the side you don’t choose across the line

The nice thing about this is that it translates to the GPU quite readily because the folding process is independent for each pixel.  Also, nearly all the operations involved are 2D vector operations which reduce to a single cycle in the GPU.  To make it all work, I store the fold information in a texture as input data for a fragment shader program.  Then, the fragment program reads the folding information, performs the folds, and selects the color.  One instance of the program looks like this:

foo001.png

Neat!  What’s even cooler is that my GPU can render the image in less than a second.  This means we can animate the folds.  If we pick a fold and slowly rotate it, you can get some pretty neat animation.   Check it out here.  Cool, eh?

400+ Kanji / Vancouver Strike Ends / Wet Wizard

October 14, 2007 by sfingram

Okay, I’m at over 400 Kanji now.  Just around 100 more and I’ll be a quarter of the way toward my goal of 2,000.  I haven’t been making the progress that I wanted, but life intervenes.  Kelsey and I have been on a “taking care of business” track recently, and I have had to prioritize.  For me family always comes first, then work, then interests.

In more relevant news, the Great Vancouver Civic Strike of 2007 is over!  Garbage will be collected.  My mountain of milk jugs and aluminum cans will be recycled.  We can take Eleanor to the community center on rainy days.  The librarians are still striking, but since I use the UBC library, this doesn’t hinder me in any way (directly).   Correction:  the big book sale was canceled, which sucks.  Last year we bought as many as we could physically carry at bargain prices (55 cents for novels of any size, 2 bucks for nonfiction, etc.).  Oh well, I have enough to read for now anyway.

Besides, when I crave used books these days I go to Wet Wizard.  He’s got some decent stuff and the prices are more than fair.  We especially like to buy old National Geographics from him for Eleanor.  Plus, he’s a good guy.