Archive

This page is an archive of stuff I've done in the past. In particular, it has notes I've taken from several books, programs I've written to study various things, and old homework sets from classes I've taken.


alphabet.pl

A simple perl script that tests the user on the military alphabet. (Alpha, Bravo, Charlie, etc.) I wrote it to help with some flying lessons I took: alphabet.tgz

Side Note: This small perl script is saved in tar-gzip'd form, b/c when I tried to link to it as a perl script, or even as a gzip'd perl script, pair.com's server wanted to execute it, rather than treating it as a regular text file.


bash

I read through ``Learning the bash shell,'' 2nd ed., by Cameron Newham and Bill Rosenblatt. I wrote out the example scripts and solved most of the exercises, as well as adding options, customizations etc. to my bash config files. The results are here: bash.tgz


BasisTime/Black-Derman-Toy code

I wrote up some code to compute times in the 3 time conventions usually used in finance: 30/360, Act/360, and Act/Act. The code doesn't contain the most efficient algorithm in the world, but it gets the job done. The tarball also contains code for pricing options by the Black-Derman-Toy model; this method is taken from the Rebanato book referenced further down. BDT.tgz


Black-Derman-Toy model

I read over the paper by Black, Derman, and Toy which details their 1-factor model for pricing interest-rate options. This word document contains the reference to that paper, and the notes I took of it: Black-Derman-Toy.doc


BLS VBA Scripts

During the summer of 1998, I worked at the Bureau of Labor Statistics in Washington, DC. While there, I learned some VBA stuff. The tarball contains some VBA macros I wrote there, and some associated documentation: BLS.tgz


Econometrics of Financial Markets, by Campbell, Lo, and MacKinlay

Chapter 1 Intro, and Sections 1.1, 1.2, 1.3: MS Word, PDF


Excel Notes

Text file holding tips/notes etc. ExcelNotes.txt


Excel/VBA in Easy Steps

Macros from the book by Ed Robinson: Excel/VBA In Easy Steps


Cellular Automata

A simple VBA script, implements simple alife by coloring black and white cells in an Excel worksheet. A fun little script to do this, and also to remember VBA syntax stuff: Cellular.xls


CGI Scripts

When I was at NYU, I wrote a couple CGI scripts in perl, as a fun project to see how they worked. A couple notes:

The scripts aren't the most elegant, since I was just learning perl at the time. However, they work correctly, and are reasonably readable: cgi.tgz

Also: one of the scripts collected fundamental data on companies from a stock research web site, and used it to perform some ratio analysis, such as Price to Earnings, Book to Market, etc. I wrote up some notes of the ratios and why they're supposed to be important: Ratio_Analysis.doc


convertRate.pl

A simple perl script to convert an interest rate from one compounding frequency to another. (For example, continuous to semi-annual.) Again tarred and gzipped so that the web server doesn't try to execute it.

convertRate.tgz


C++ How to Program, by Deitel & Deitel, First Edition, 1994

Links give the sample programs from each chapter, tarred together and gzipped. Chapters 4 and 16 don't have all the programs from the chapter.

Chapter 1, Intro. to Computers and C++ Programming
Chapter 2, Control Structures
Chapter 3, Functions
Chapter 4, Arrays
Chapter 6, Classes and Data Abstraction
Chapter 7, Classes, Part 2
Chapter 8, Operator Overloading
Chapter 9, Inheritance
Chapter 10, Virtual Functions and Polymorphism
Chapter 11, C++ Stream Input/Output
Chapter 12, Templates
Chapter 15, Data Structures
Chapter 16, Bit, Characters, Strings and Structures


FAME

FAME is a database system which is very efficient at dealing with time-series data. FAME is used a bit at Putnam. I worked through the following tutorial exercises to help learn it: fame_tutorial.tgz


Genetic Algorithms Tutorial

A friend in New York gave me this tutorial, unfortunately there was no author/attribution given with it; it was a chapter out of a book. It described several different basic GA's for maximizing a highly oscillatory function. I implemented these algorithms using Object-Oriented perl. A couple caveats:

Tarball of the GA's: OOPL.tgz

Later Note: I also implemented some of these GA's in C++, as a fun project while working through Bjarne Stroustrup's The C++ Programming Language. The tarball contains GA's 1-1, 2-1, and 2-2: OOGA.tgz


Options, Futures, and Other Derivatives, 3rd edition, by John Hull.

Chapter 1. Introduction

Section 1.1. Forward Contracts: TeX, ps
Section 1.2. Futures Contracts: TeX, ps
Section 1.3. Options: TeX, ps
Section 1.4. Other Derivatives: TeX, ps
Section 1.5. Types of Traders: TeX, ps
Section 1.6. Summary: TeX, ps

Problem 1.4. TeX, ps
Problem 1.6. Source tarball, ps
Problem 1.10. Source tarball, ps
Problem 1.11. Source tarball, ps
Problem 1.14. Source tarball, ps
Problem 1.16. TeX, ps
Problem 1.18. Source tarball, ps
Problem 1.20. Source tarball, ps
Problem 1.21. Source tarball, ps
Problem 1.22. Source tarball, ps
Problem 1.23. TeX, ps
Problem 1.24. Source tarball, ps

Section 4.1. Some Preliminaries: TeX, ps
Section 4.2. Forward Rate Agreements: TeX, ps

Section 16.1. Exchange-Traded Interest Rate Options: TeX, ps
Section 16.2. Embedded Bond Options: TeX, ps
Section 16.3. Mortgage-Backed Securities: TeX, ps
Section 16.4. Option-Adjusted Spread: TeX, ps
Section 16.5. Black's Model: TeX, ps
Section 16.6. European Bond Options: TeX, ps
Section 16.7. Interest Rate Caps: TeX, ps

Chapter 16, Section 5: MS Word, PDF

Problem 16.6. TeX, ps
Problem 16.11. TeX, ps
Problem 16.13. TeX, ps
Problem 16.15. TeX, ps


Elements of Programming with Perl, by Andrew Johnson

Excellent book for a good foundation of perl. Tarball contains the sample programs from each chapter, as well as the exercises: ElemProg.tar.gz


Investigations, by Stuart Kauffman

Preface: Postscript, TeX source


Maryland classes

Here are some archives of stuff I did for classes I took at the University of Maryland.

Cmsc 113, Computer Science II
Mapl 460, Numerical Methods I
Math 472, Methods of Applied Mathematics I
Math 473, Methods of Applied Mathematics II


Matlab stuff

Matlab primer, by Kermit Sigmon. A bit dated now, but still an excellent introduction to doing stuff in matlab.


Nonlinear Pricing, by Christopher May

Preface: MS Word, PDF
Chapter 1: MS Word
Chapter 4: TeX, dvi


MIT Classes

Here is an archive of a class I took at MIT:

18.325, Topics in Random Walks and Diffusions


NY Times articles on Enron Capital and Trade, and the derivatives contracts they've developed:

Article 1
Article 2


NYU Classes

Some tarballs of the homeworks, etc. for the classes I took at NYU while working toward the MS degree in Mathematics in Finance.

Banking and Finance, Fall 1998
Computing in Finance, Fall 1998
Mathematical Finance I, Fall 1998
Numerical Methods I, Fall 1998

Mathematical Finance II, Spring 1999
Pricing and Hedging, Spring 1999

Computational Methods in Finance, Fall 1999
Econometrics, Fall 1999
Risk Management, Fall 1999

Note the Risk Management archive is rather sparse. This is because I used the mtools command mcopy a:<dir>, where <dir> was the directory holding the risk management stuff. What I learned the hard way is: This doesn't recursively copy the directory structure, as with cp -r in Unix. It only copies the files in that dir, not the sub-dirs. :-(


Numerical Recipes in C, by William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery

Chapter 10, Section 0. Introduction: TeX, ps pdf
Chapter 10, Section 1. Golden Section Search in One Dimension: TeX, ps pdf
Chapter 10, Section 2. Parabolic Interpolation and Brent's Method in One Dimension: TeX, ps pdf
Chapter 10, Section 3. One-Dimensional Search with First Derivatives: TeX, ps pdf
Chapter 10, Section 4. Downhill Simplex Method in Multidimensions: TeX, ps pdf

Source code:

Utility functions: nrutil.h
Chapter 10: NumRecip10.tgz, NumRecip10.zip


Interest Rate Option Models, by Riccardo Rebanato

Chapter 8, MS Word, PDF
Chapter 11, MS Word, PDF
Chapter 12, Sections 12.1, 12.2, 12.3, 12.4, MS Word, PDF


R/S Analysis

I read parts of ``Chaos and Order in the Capital Markets,'' by Edgar Peters. I wrote the perl script RS.pl to compute the R/S value of a few different data series. The files ibm.ret and msft.ret give daily log-returns for IBM and MSFT from Oct 1997-Dec 1999. The tarball contains everything together: RS.tgz


sierpinski.m

Another program from ``Chaos and Order in the Capital Markets,'' by Edgar Peters. This matlab script implements the Chaos Game by Michael Barnsley, for the Sierpinski Triangle: sierpinski.m


Space Stuff

I'm a little bit of a space geek. I've followed the activities of a few private space groups at different times.

Artemis Society

Artemis Society is a society which aims to make a private trip to the moon. I've archives several e-mails, etc. from their mailing list: Artemis.tgz

Prospace

Prospace is a political lobby that seeks to have the government encourage private space enterprise through laws, tax credits, etc. I made an archive of some of the e-mail updates they sent out over 1997-1998: ProSpace.tgz

Space Access Society

Space Access Society is also a political lobby, as well as hosting an annual conference of people involved in private space enterprises. I archived their Space Access updates 60-79 here, along with a couple alerts that came out during that time: SpaceAccess.tgz


Swarm Stuff

I've spent some time looking at issues in Swarm, a set of libraries for implementing simulations in complexity studies. Some of the stuff I've done:

Artificial Stock Market, CAPM Model

I spent some time working on an extension of the Sante Fe Articial Stock Market Model. This tarball contains all the code, etc. Look under the subdirectory 'doc' within the tarball for all the current documentation. The extensions implement a CAPM-approach to investor allocation in the market: ASMC.tgz

Buttons and Threads

As a fun project, I made a Swarm sim to implement Stuart Kauffman's ``Buttons and Threads,'' example from his books ``Investigations'' and ``At Home in the Universe'': BoutonThread.tgz. A couple notes:

CAPM Models

These simulations take a different approach to CAPM modelling in Swarm. Specifically, all investors are CAPM investors, and the sim test whether they situate themselves along the efficient mean-variance frontier. Different effects are introduced, such as when the investors make errors in their forecasts: CAPM.tgz. btw, Sorry the sims are a little light on the documentation.

Market Force, Ecology, and Evolution, by Doyne Farmer

In 2001 I spent some time reading over a paper by Doyne Farmer on agent-based markets. The paper is available from his home page here as number 98-12-117, "Market Force, Ecology, and Evolution." I used swarm to code up several of the scenarios described in the paper. The code is available here.

Master's Thesis Proposal

I spent some time reading over the Santa Fe Artificial Stock Market model. At one point I was going to extend it as part of my Master's Thesis work. I'm saving here the proposal for that work, because it has a decent summary of the ASM and what its tenets are: Proposal.doc. Also here's the official ASM documentation from the Santa Fe Institute: ASM-documentation.doc

testLisp

A simple test program for the LispArchiver in (objective-C) Swarm. This program shows you the proper format to enter instance vars to be read in by LispArchiver. It does this by saving a simple object, that you create, in the proper format: testLisp.tgz


TeX

ps document showing some of the most frequently used characters in TeX. This document is a saved copy of this page hosted on O'Reilly. I made a copy here just in case the O'Reilly page ever goes away.

I also worked through the tutorial ``A Gentle Introduction to TeX,'' by Michael Doob of the University of Manitoba. I got this document from here. I read all the chapters of the tutorial and completed the exercises. The result is here: gentleTex.tgz. The tarball contains the TeX source code for the tutorial, a local pdf copy of the typeset document, and my TeX source code for the exercises.


Unix Notes

Tidbits for use in Unix. These are factoids which are interesting, but will probably get forgotten if not written down. Directory with several text files: UnixNotes