Below are all the news postings from the 2007-2008 school year.

4/23/2008

  • Posted full 4/14 lecture in the "PowerPoint Lectures" section.
  • Posted full 4/21 lecture in the "PowerPoint Lectures" section.
  • Added 4/14 and 4/21 posts to the Class Blog.
  • Posted credit crisis article in the Class Blog, or download it here.

4/21/2008

  • Posted 4/21 lecture in the "PowerPoint Lectures" section.

4/14/2008

  • Posted full 3/31 and 4/7 lectures in the "PowerPoint Lectures" section.
  • Posted 4/14 lecture in the "PowerPoint Lectures" section.
  • Added 3/31 and 4/7 posts to the Class Blog.

4/7/2008

  • Posted 4/7 lecture in the "PowerPoint Lectures" section.

3/30/2008

  • Posted 3/31 lecture in the "PowerPoint Lectures" section.
  • Posted learntex.pdf syntax examples in the "PowerPoint Lectures" section.  Thanks to James P. Kirby at the University of Chicago for the document.
  • Updated class syllabus to reflect bootstrapping lectures.

3/24/2008

  • Posted full 3/24 lecture in the "PowerPoint Lectures" section.
  • Added 3/24 post to Class Blog along with a link to Bayao Zheng's website with Excel interface examples. 

3/24/2008

  • Posted 3/24 lecture in the "PowerPoint Lectures" section along with some market data. 

3/10/2008

  • Posted full 3/10 lecture in the "PowerPoint Lectures" section.
  • Added 3/10 post to the Class Blog.
  • NOTE: Algorithmic trading file available for download in the class blog, or HERE.

3/9/2008

  • Posted full 3/3 lecture in the "PowerPoint Lectures" section.
  • Added 3/3 post to the Class Blog.
  • Posted 3/10 lecture in the "PowerPoint Lectures" section.

3/2/2008

  • Posted full 2/25 lecture in the "PowerPoint Lectures" section.
  • Added 2/25 post to the Class Blog.
  • Posted 3/3 lecture in the "PowerPoint Lectures" section.

2/25/2008 

  • Posted 2/25 lecture in the "PowerPoint Lectures" section.

2/21/2008

  • Posted full 2/18 lecture in the "PowerPoint Lectures" section.
  • Added 2/18 post to the Class Blog.

2/17/2008

  • Posted 2/18 lecture in the "PowerPoint Lectures" section.

2/13/2008

  • Posted full 2/11 lecture in the "PowerPoint Lectures" section.
  • Added 2/11 post to the Class Blog.  In this blog entry I addressed some questions from students regarding the latest project assignment.

2/10/2008

  • Posted 2/11 lecture in the "PowerPoint Lectures" section.
  • NOTICE: I will not be attending office hours on February 14th, Valentine's Day.

2/04/2008

  • Posted full 2/4 lecture in the "PowerPoint Lectures" section.
  • Added 2/4 post to the Class Blog.

2/03/2008

  • Posted 2/4 lecture in the "PowerPoint Lectures" section.

1/29/2008

  • Posted full 1/28 lecture in the "PowerPoint Lectures" section.
  • Added 1/28 post to the Class Blog.

1/27/2008

  • Posted 1/28 lecture in the "PowerPoint Lectures" section.
  • Updated syllabus for spring 2008 semester.
  • Students should report to the same computer lab classroom as used in the fall semester on the first day of class, 1/28.

12/02/2007

  • Posted full 12/03 lecture in the "PowerPoint Lectures" section.

12/01/2007

  • Posted full 11/26 lecture in the "PowerPoint Lectures" section.
  • Added 11/26 post to the Class Blog.

11/26/2007

  • Posted 11/26 lecture in the "PowerPoint Lectures" section.

11/23/2007

  • Posted full 11/19 lecture in the "PowerPoint Lectures" section.
  • Added 11/19 post to the Class Blog.

11/18/2007

  • Posted 11/19 lecture in the "PowerPoint Lectures" section.

11/15/2007

  • Posted full 11/12 lecture in the "PowerPoint Lectures" section.
  • Added 11/12 post to the Class Blog.
  • Added general comments on the final projects due in the remainder of this semester to the Class Blog.

11/12/2007

  • Posted 11/12 lecture in the "PowerPoint Lectures" section.

11/05/2007

  • Posted full 11/05 lecture in the "PowerPoint Lectures" section.
  • Added 11/05 post to the Class Blog.
  • Updated the class syllabus with semester-end presentations and clarification of collaboration policy.

11/04/2007

  • Posted 11/05 lecture in the "PowerPoint Lectures" section.

10/29/2007

  • Posted full 10/29 lecture in the "PowerPoint Lectures" section. Added 10/29 post to the Class Blog.

10/22/2007

  • Posted full 10/22 lecture in the "PowerPoint Lectures" section, including asnwers to the in-class challenges.
  • Added 10/22 post to the Class Blog.

10/21/2007

  • Posted 10/22 lecture in the "PowerPoint Lectures" section.

10/15/2007

  • Posted full 10/15 lecture in the "PowerPoint Lectures" section, including answers to the in-class challenges.
  • Added 10/15 post to the Class Blog.

10/14/2007

  • Posted 10/15 lecture in the "PowerPoint Lectures" section.

10/08/2007

  • Posted full 10/08 lecture in the "PowerPoint Lectures" section, including answers to the in-class challenges.
  • Added 10/08 post to the Class Blog.

10/07/2007

  • Posted 10/08 lecture in the "PowerPoint Lectures" section.

10/01/2007

  • Posted full 10/01 lecture in the "PowerPoint Lectures" section, including answers to the in-class challenges.
  • Added 10/01 post to the Class Blog.

09/30/2007

  • Posted 10/01 lecture in the "PowerPoint Lectures" section.

09/24/2007

  • Posted full 9/24 lecture in the "PowerPoint Lectures" section, including answers to the in-class challenges.
  • Added 9/24 post to the Class Blog. 

09/23/2007

  • Posted 9/24 lecture in "PowerPoint Lectures" section.

09/20/2007

  • Added three Visual C++ examples for download.

09/17/2007

  • Posted full 9/17 lecture in the "PowerPoint Lectures" section, including answers to the in-class challenges.
  • Added 9/17 post to the Class Blog.

09/16/2007

  • Posted 9/17 lecture in "PowerPoint Lectures" section.

09/13/2007

  • Added one Cocoa example for download. 
  • Updated syllabus with current office hours.

09/11/2007

  • Added two Cocoa examples for download. 

09/10/2007

  • Added 9/10 lecture to the "PowerPoint Lectures" section of the site.
  • Added 9/10 post to the Class Blog.

08/25/2007

  • Added "Cocoa Examples" section and updated syllabus for the fall 2007 semester.

07/10/2007

  • Added two Visual C# examples for download.

07/07/2007

  • Added two VB2005 examples for download.

06/25/2007

  • Added three MatLab examples for download.

06/10/2007

  • Added four MatLab examples for download.
  • Added four Visual C# examples for download.

06/03/2007

  • Added MatLab examples for download.
  • Added "The Fractal Geometry of Nature" as a recommended book.
  • Added "PowerPoint Lectures" section to site.

Below are all the blog postings from the 2007-2008 school year.

9/10/2007

Today in class I introduced the class syllabus and we had a short quiz to gauge students' knowledge.  Students set up their IT Labs account, if they had not already done so.  In the second half of class I introduced MATLAB.  We created several kinds of matrices and experimented with editing and modifying their values.  We addressed multiplying matrices, determinants, and generating random values, both uniform and normal.

Class question: How do you "seed" the random number generator?

Answer: Use the rand('seed') command to seed the value when generating random numbers for the first time.

9/17/2007

Today's class focused on MATLAB scripts and functions.  We learned how to create m-files and use the debugger tool to find glitches in the code.   MATLAB scripts were introduced and students created their own scripts.  Functions were also introduced and students created m-file functions as well as anonymous functions.  The last half of class was an introduction to logic and flow control statements.  Students completed a couple challenges using the For loop.

Class question: How do you find an appropriate seed value?

Answer: When using the rand('seed') command, specify cputime as a parameter.  The command rand('seed',cputime) should generate a sufficiently random seed for your random number generator.

Class question: How do you call a function with more than one output matrix?

Answer: At the command line, enter [matrix1, matrix2] = function_name(parameters).  matrix1 and matrix2 should be equal to the number of output parameters the function uses.  For example, if the function has three output matrices, enter [matrix1, matrix2, matrix3] = function(parameters).

Teacher comments: To compare the value of two strings, use the strcmp(...) function.  Refer to the MATLAB help file for strcmp syntax.

9/24/2007

Class began with a brief continuation from last week on the topic of functions and calling functions from functions.  We then introduced the & and | operators.  The majority of this class was dedicated to working with outside data sources.  We learned how to read Excel files, write Excel files, and determine properties of Excel files.  We also learned how to read and write data from text files.  Finally we learned the specifics of using binary files to store and retrieve data.  The class ended with a challenge for students to use MATLAB to convert a binary file into an Excel file.

Class question:  When using the fwrite() function, what does the number that gets returned represent?

Answer: The number is the total number of scalars in the matrix which is written to the binary file.

Class question: What is the difference between && and &, and also || and |?

Answer: In short, the && and || operators are used when comparing scalar values, and the & and | operators are used when comparing matrix values.

Class question: Can more than one function be stored in a single m-file?

Answer:  Yes, but only under certain circumstances.  Click here to look at the MathWorks site on "Types of Functions."

Class question: How do you read both numeric and string data from an Excel sheet using the xlsread() function?

Answer: If you use the syntax [num, txt] = xlsread(filename, . . . ), the numeric data will be returned to the "num" matrix and the string data will be returned to the "txt" matrix.

10/01/2007

Today's class began with some problems regarding MATLAB.  The downloaded student version of MATLAB does not come with the statistics toolbox, which is needed to use the cdf() function.  Also, the downloaded version omits the symbolic math toolbox.  I am in the process of trying to find a download for students.  If all else fails, students can buy the full version with the toolboxes through www.umart.umn.edu.

The first half of class we spent reviewing the first project and going over the basics of symbolic math in MATLAB.  Hunt and Kim gave brief presentations on their projects.  The second half of class was an introduction to the Black-Scholes model and we addressed some basic questions about options.  We then implemented both call and put m-file functions.  Students participated in a brief exercise to determine whether or not an option was priced incorrectly according to the model.  Finally, the next MATLAB project was assigned.

Class question: For the portion of the assignment in which a distribution must be decided by the user, what if the distribution requires more inputs than simply mean and standard deviation?

Answer: For the purposes of this assignment, accept only mean and standard deviation values from the user.  Use arbitrary values for all other parameters.

Class question: With regard to the interface portion of the assignment, does each function need to be broken down separately?  Can the function that calculates the value of a call also calculate the Greeks automatically?

Answer: Yes, that is acceptable.  The design of the interface will be left up to students.  It should be well documented and clear to a novice user what data needs to be input.

Teacher comments: If you want to prompt the user for data in MATLAB, use the following syntax: variable_name = input('prompt text here')

10/08/2007

We began class with an exercise to calculate the value of a call option using the Black-Scholes model we created during last class in MATLAB.  This class focused primarily on Visual Studio and provided an introduction to the Visual Studio suite.  We offered a brief introduction to object-oriented programming and completed the class with an introduction to Visual Basic 2005.

Class question: After using the debugger to break the code while running, how do you resume the program running?

Answer: Click the "Play" icon again or just hit F5.

Class question: Can underscores be used in the names of variables in VB2005?

Answer: Yes.

Class question: If a numeric variable is created, will it initialize with a value automatically?

Answer: Yes, it will initialize with a value of zero.

Class question: What character is used to comment code in VB2005?

Answer: Use a single quote character ' to add comments to code.

Class question: How is both a string and the value of a matrix displayed on the same line in MATLAB?

Answer: Use the sprintf() function to display all the output on a single line in some format.  For example, if the value 50 is stored in matrix A, I could use the command sprintf('%s', 'The value of matrix A is: ', A) to output the desired string followed by A.  Refer to MATLAB help for more information on syntax.

10/15/2007

Today we continued our unit on Visual Basic 2005.  We began by introducing variable scope as either contained within an event or available throughout a class.  Then we introduced some basic controls such as the label, textbox, and checkbox.  The second half of the lecture was dedicated to flow control statements in Visual Basic 2005.  The class concluded with a brief talk on bond duration and the assignment of the duration project.

Class question: Is it possible to create a control array in a manner similar to VB6?

Answer: No, control arrays are no longer supported in .NET per se.  However, the effective equivalent of a control array can be accomplished by assigning several controls to the same event handler.  Reference this MSDN article for further information.

Class question: How would a textbox be coded to recognize a user pressing the Enter key?

Answer: First, create a KeyDown event associated with the textbox.  Then input the following code in the KeyDown event: "If e.KeyCode = Keys.E" Then ...  In this example "e" is referencing a value passed to the event that can be used within the event.

Class question: If a global variable is assigned a value within an event, does the global variable retain that value after the event ends?

Answer: Yes.  The idea is that a global value can be referenced and changed among many events.

Class question: If a variable is declared only within an event can that variable name be used by another event?

Answer: Yes.

10/22/2007 

Today we spent the first portion of the class reviewing the Black-Scholes model project in MATLAB.  We then reviewed the duration project due this Sunday in VB.  In the remainder of the first lecture we introduced modules in Visual Basic and tried creating functions and subs.  The second half of the class was an introduction to arrays in Visual Basic.  We finished the class by creating an example project that included an array declared within a module and used a function and sub to modify it.

The formulas below are the corrected versions of formulas included in the last lecture.  The formulas in the lecture omitted parenthesis.

Macaulay duration:

 

 

Modified duration:

Class question: When a VB function returns a value, does that action terminate the function?

Answer: Yes.

Class question: Is it required that a button be used on the coming assignment?

Answer: No, there is no requirement that a button is used, but remember that an event must be raised somehow to perform the calculation.  A button is probably the easiest way to do that.

Class question: Which is the project file in the directory containing the VB project?

Answer: Project files are also known as "Solutions" and have the extention ".sln".

Class question: What should be sent to submit a VB project?

Answer: Zip the entire directory and send it.  Remember that .exe files will not be accepted by Gmail (even in a zip!) so change the .exe extension to something else before sending it.

Class question: How is a string converted to an integer in VB?

Answer: Use Convert.ToInt16(string to convert) to convert a string to an integer.  Note that ToInt16 will convert the string to a 16 bit integer.  A different integer type may be needed.

Class question: Where the executable associated with a Visual Basic project be found?

Answer: In the project folder, the executable can be found the following directory project name\bin\Debug.

Class question: Do comments need to be included with VB projects?

Answer: Yes.

Class question: How is a string represented in VB?

Answer: When setting something equal to a string, use " "s to define the text to set.

Class question: Can arrays of two different sizes be copied to each other?

Answer: Yes, but data will be lost in the process if a smaller array is set equal to a larger array.

Class question: What will LBound(...) return if it references an array with no size?

Answer: It will return null.

Class question: Why is Convert.ToInt64(...) returning the error "Input string was not in a correct format"?

Answer: The user is probably entering a value that is not valid.  For example, a blank value or a negative symbol will raise an error.

Teacher comments: Don't forget to compress your homework using a RAR file before sending it to Gmail!

10/29/2007

Class today was the final installment of the VB2005 unit in class.  The first half of class was an introduction to databases in Visual Studio.  We created an Access database and then used the database connection in Visual Basic to view and edit the data in the table.  The second half of class introduced the CRR binomial option pricing model.  After reviewing the model, we implemented a portion of the assignment in class and then adjourned. 

Class question: Does the Try...Catch block erase any data if the Try code block generates an error?

Answer: No data is erased if an error occurs, unless code within the block erases the data.

Teacher comments: In the 8.2 lecture I indicated that t = days/steps in an early slide.  This is incorrect.  The correct value is t = years/steps.

Teacher comments: Note that in the CRR model volatility is assumed to be per annum.

Teacher comments: In the 8.2 lecture, there is a mistake in the defined parameters.  The lecture indicates that there is 1 year until expiration.  In fact, there are 360/365 days until expiry.  Your model should yield a slightly different value for exactly 1 year.  To test values of your model, use the following link: http://www.hoadley.net/options/options.htm.

11/05/2007

We began class today with a review of some of the best projects submitted for the previous assignment.  I made an announcement clarifying the extent to which students can collaborate on projects.  An updated policy has been added to the syllabus.  The class focused on an introduction to C#.  Operators, methods, variables, and classes were all introduced.  A number of "5 minute challenges" were offered with opportunities for extra credit if completed correctly.

Class question: If an "if..." statement is followed by an "else..." does the code within the "else" execute without regard to the "if" portion?

Answer: No.  The "else" portion is only executed if the "if" portion is untrue. 

11/12/2007 

Monday we continued working with C# in the context of classes, arrays, and other data structures.  Specifically we discussed creating classes and methods within those classes.  We discussed static methods and creating instances of classes.  We ended class with an introduction to arrays, queues, arraylists, and stacks, and assigned the fifth project, the yield calculator in C#.

Class question: Where is the entry point of a program in C#?

Answer: There are a few things that could be considered an entry point.  In a form, the entry point would probably be considered the "Form_Load" event which is called when an instance of the form loads.  In a class, the entry point is known as the constructor.  In the "Program.cs" file in a project, there is a method which is executed which serves as the entry point for the program.

Class question: Why is "public" and "private" relevant for a constructor?

Answer: Just as with any other method in a C# class, "public" and "private" determine whether those methods can be called from outside the class.  A "public" method can be called from a form, for example, whereas a "private" method cannot.

11/15/2007

At the request of several students I am posting some information about the final projects due in class by the end of the semester.  These are only intended to be broad comments on the projects to give students a head start.  Do not take these comments as gospel.

The next project assigned will be a "major" project written in C#.  The assignment will be to create a geometric Brownian motion generator.  The following are some components of this project:

  • Create a C# class that generates geometric Brownian motion of n steps.
  • Create a C# method that generates N(0,1) random numbers using the Box-Muller transform.
  • Devise a way to export data generated by your program.  Data may be exported to Excel, MATLAB, or plain text format.

The final project is more open and flexible.  Students will be expected to implement one of the three things listed below in either MATLAB, Visual Basic, or Visual C#.  Some projects are clearly more difficult than others.  Grading will be adjusted to account for difficulty.  In other words, an "easy" project is expected to be nearly flawless.  A "hard" project will still receive a strong grade even if substantial problems exist.

  • Implied volatility calculator - "Easy"
    • Newton-Raphson method
  • Vasicek interest rate model - "Medium"
    • Ornstein-Uhlenbeck process
  • Schwartz & Smith commodity model - "Hard"
    • Google for the paper; GBM + OU + more

These models will be discussed further in class, but each method or process listed below the project is intended to be a hint which opens the door to a substantial part of the project.

11/19/2007

The first half of class was spent discussing methods for writing data from a C# program.  Specifically, we discussed using text files to read and write data.  We also discussed using Excel to export data from an array.  The second half of class was dedicated to the C# Brownian motion project and the final project choices.

Class question: Can a path be referenced from a string?

Answer: Yes.  Make sure to use "@" to make the string literal, however.  For example, say the string PATH had the value "c:\mytext.txt" and that variable was being referenced to open a file.  The correct syntax would be @PATH to reference the literal value of the string within the context of an argument.

Class question: How can output be formatted?  For example, how can output be formatted in dollars?

Answer: Use String.Format(...) to format the output of data.  For example, if a dollar format is needed, the correct syntax would be String.Format("{0:c}", value), which would return "value" rounded to two decimal places and with a "$" added.

Teacher comments: It was brought up in class that my slide describing the math behind Brownian motion indicated a value of v/t for the volatility measure.  Allow me to offer some detail.  First of all, the value should be v/sqrt(t), where v is the sigma value and t is the unit of time being simulated.  For example, with an annualized volatility of 50%, assuming the simulation is designed such that one step = one day, then t = 1/252.  Therefore, v = 0.5/sqrt(252).  This amendment has been made to the 11.2 lecture slides.

Teacher comments: I should point out that although part of the Brownian motion assignment indicates that a Box-Muller transform must be used to generate N(0,1) random values, students are welcome to use any algorithm that may be more suitable or more efficient.

11/26/2007 

This week class lectures addressed extended interface functionality in Visual Studio and a discussion of OOP in C#, focusing specifically on inheritance.  Remember that next week presentations begin.  Students will be allowed to volunteer to present.  After all volunteers are finished, I will select students at random to present.  The Brownian motion in C# project is due on Sunday, December 9th at midnight. 

1/28/2008

This was the first week of class of the spring 2008 semester.  We began class by reviewing a couple key concepts from last semester and discussing why we are going to the trouble of pricing options.  Brownian motion was the main topic of the lecture and we continued our discussion from last semester by reviewing the GBM formula and implementing a scenario generator in MATLAB.  The first half of the lecture concluded by describing how to price a European option using simulation.  The second half was a discussion of making intuitive judgements about relative option values and the week's assignment: using GBM to compute the value of a barrier option.  Barrier options were discussed at length and several "real world" examples were used to illustrate how a barrier functions.

Class question: Must MATLAB be used for the assignment?

Answer: Yes.

Teacher comments: There are a handful of calculators online that price barrier options.  These calculators can be used to get a sense for what the barrier values should be, which is useful when debugging code.  The sites with the calculators can be found using Google, but if anyone has problems finding a resource please let me know.

2/04/2008

We began class this week with an announcement that Securian is offering two quantitative analyst internships for the coming summer.  Students are encouraged to apply through www.securian.com.  We then conducted a review of the Brownian motion generator along with a demonstration of option pricing using a scenario generator.  Excel was the topic of the day and we spent the first lecture introducing some Excel basics.  In the second half of class we introduced macros in Excel and offered an introduction to VBA.

2/11/2008

This week's class focused on  VBA syntax and hierarchy.  We discussed UserForms, Modules, and Classes.  The second half of lecture was an introduction to controlling the worksheets from code.  We covered examples of selecting ranges and individual cells, and applying various formatting to ranges of cells.  The final portion of class was an introduction to the second project assigned in class: a deterministic interest rate scenario generator.

Teacher comments: I have received a number of questions about the interest rate scenario generator, so I'll try to provide some clarification.  Once the user has input the given points on the yield curve and interpolation has been performed to find the unknown points, the yield curve should remain static.  The curve should then shift up and down depending on the scenario, but every point on the curve should move by the same amount.  So, if the scenario calls for a one percent increase in rates per year, the entire curve should shift up one percent per year, but it should retain its shape.  An illustration is given below.

2/18/2008

We began this week's class by having a handful of students make presentations on the first assignment of the semester, pricing options with geometric Brownian motion.  I selected students to present on the basis of design, interface, and algorithm.  Students should be aware that I generally do not offer the most efficient way to complete a problem as an example method to complete the project.  I expect some students to devise improved methods for computation.  I introduced Types in VBA and Option Explicit in the remainder of the first half of class.  The second half of class was dedicated to arrays in VBA.  I conducted an example of the speed difference between writing and reading data to and from worksheets and arrays.  I encouraged students to always use arrays over worksheets.  The class concluded with a revisit to Classes in VBA, OOP, and a final question and answer session for the second project.

2/25/2008

The first half of this week's lecture was an introduction to market data sources available for a reasonable price.  I introduced using worksheet functionality in VBA code and followed-up last week's presentation using the NormSDist function built into Excel.  We also discussed importing and exporting data in Excel using CSV files.  The second half of class was dedicated to the delta hedge simulator project in Excel.  The thrust of this project is to demonstrate how delta hedging actually functions and highlight the fact that delta hedges create interim gains and losses.  Students' assignment is to create a simulator that uses geometric Brownian motion as the underlying process to model the evolution of a stock price.  Then, using the Black-Scholes model, delta values should be calculated at each step and a hedge position adjusted.

Class question: Can Excel worksheet functions be used on variables only declared in code, or must they be used exclusively on an existing worksheet?

Answer: Worksheet functions can be applied to a variable used in code as well as data in a worksheet.

3/3/2008

This week we had a guest speaker for the second half of class.  Kent Horsager from Compass Strategic Investments came to present some of the strategies his fund uses.  Specifically, he presented the idea of trading spreads and making markets in canola options.  He demonstrated some of the software that he uses in his strategies and described the nature of the various electronic marketplaces.  The first half of class was spent discussing algorithmic trading in broad terms and offering students and introduction to the idea of automating strategies.

3/10/2008

Due to my illness, today's class adjourned roughly one hour early.  We spent most of the class going over the assignments for the final project and for the next assignment, the algorithmic trading project.  The algorithmic trading project involves two scenarios in which students must decipher a pattern of trades and write code to generate these trades based on simulated market conditions.  I introduced the idea of creating Excel Add-ins to augment functionality and distribute useful tools.  I finished class with a review of the Box-Muller transform, which is a method to turn uniform random numbers into normally distributed random numbers.

Teacher comments: Download the algorithmic trading project file HERE.

3/24/2008 

We began class today with a review of the Project #4 assignment.  The first scenario that was assigned was a simple Brownian motion with jumps at every tenth step.  The second scenario should have been straightforward to find profit opportunities.  Since all the data was historical, fitting trades to the spread is a matter of finding minimums and maximums.  The primary thrust of class was an introduction to PCA.  The first half of class was dedicated to performing PCA using MATLAB's SVD feature on a couple simple matrices.  The second half of class applied the same PCA methodology to a couple actual financial data sets.  We concluded class with the PCA assignment.

Class question: Is there any correlation between the columns of the approximation matrices generated using the SVD function?

Answer: Yes, the correlation is either -1 or 1.

Teacher comments: Special thanks for Bayao Zheng for a great presentation on the topic of Excel interfaces.  Visit his website here: http://business.libra.googlepages.com/pre

3/31/2008

LaTeX markup language was introduced this week.  LaTeX is a typesetting system used mostly for the creation of math and scientific notation.  This week we introduced the structure of TeX and how LaTeX works on top of the TeX architecture.  We covered the genesis of a TeX document as it is created as a .tex file, then compiled to a DVI (device-independent file) and then further converted into a PDF or other format.  The different aspects of a TeX document were covered, including the preamble and the body of the document.  Students were introduced to formatting, environments, some basic math notation, and various front-ends that are available to make the LaTeX experience more user friendly.

Class question: Does one need a front-end to use LaTeX?

Answer: No, it can be used from a command line.

Class question: Can LaTeX be used by downloading a front-end program?

Answer: Not entirely.  LaTeX is a package that needs to be installed independent of any front-end program.  The front-end will simply organize the steps that need to take place to compile a .tex file into a PDF or other format, and provide an easy place to edit documents.  Google "LaTeX distribution" to find sites that host an install package for LaTeX itself.  LaTeX is free.

Teacher comments: Don't wait until the last minute to install LaTeX.  In my experience, the installation process can be buggy and require some troubleshooting.

4/7/2008

This week we introduced the meat and bones of how we will be using LaTeX: math notation.  Virtually all conceivable math notation that exists can be expressed somehow in LaTeX.  The key to using math notation is to first define that the "amsmath" package be used in a given LaTeX document.  Then, once an "equation" or "math" environment has been defined, notation can be expressed.  As a rule, notation that requires obvious segregation, for example the numerator and denominator of a fraction, uses the curly brackets { and } to set aside certain portions of an expression.  Remember that the "equation" or "math" environment must always be declared in a LaTeX document before expression notation can be used.

4/14/2008

The concept of bootstrapping was introduced this week along with the construction of an economic scenario generator which will be used in the practitioner's course taught by Gary Hatfield.  Students in Gary's course will need to have a functional scenario generator to complete his assignments.  Our approach to bootstrapping started with a swap curve.  We interpolated missing points on the curve and then derived a series of zero coupon bond prices and forward rates.  This term structure of rates is used by the scenario generator.  We implemented a term structure of volatility as well.  When building the simulation algorithm, we used the common derivation of geometric Brownian motion that we've used in previous generators.  The caveat is now that mu (rate) and sigma (volatility) are being pulled from the term structure, as opposed to constant values in previous generators.

Class question: Is it possible to use the same derivation of GBM, even though the rate and volatility values are no longer constant?

Answer: Yes, as long as the rate and volatility values are deterministic, the GBM derivation presented in lecture 25 is valid.  If rates and/or volatility were instead stochastic, a different GBM formula would be needed.  As a reference, look at pages 151-156 in Riccardo Rebonato's book, Volatility and Correlation.

Class question: In the formula to calculate forward rates, why is Log(Zn) negative?  Wouldn't that produce a negative rate?

Answer: Since we are taking the Log of a zero coupon price, Zn, the Zn value will always be less than one.  Log(x) < 0 when x < 1, so we apply a negative to produce a positive forward rate.

4/21/2008

Today we opened class with the review of an article on the credit crisis, which can be downloaded here.  Specifically, we discussed what types of instruments have been affected, how those instruments were created, and behavior and incentive structures at investment banks that may have led to dishonest activity.  We also did a brief review of the requirements of the scenario generator that will be used in Gary Hatfield's practitioner seminar.  Students in Gary's class should have the generator built by Wednesday, April 23rd.  The second half of class was dedicated to a review of the topics covered throughout the year that I think are most important.  One thing I stressed was the idea of building an intuition with respect to option pricing and hedging.  Having an intuitive understanding of how Greek values affect value and hedging will serve students well in their careers.  Next week we begin student presentations.  Students will be chosen at random to present.

Below are all the lectures from the 2007-2008 school year.

0708lectures.zip