Principles of Financial Computing Course
Principles of Financial Computing
Time: 9:10 ~ 12:10 Friday (Spring Semester)
Location: Room 111 of the CSIE Building
On Wall Street, being right on the fundamentals and
wrong on the timing is the same as just being wrong.
---Jonathan Cohen
Where is the risk management at J.P. Morgan Chase?
--- Bloomberg News, January 16, 2002
10. Of course, I make a lot investing.
I only teach
so I can help young people.
--- Top Ten Lies Finance Professors Tell Their Students
- References
- F. J. Fabozzi,
Fixed Income Mathematics: Analytical & Statistical Techniques. 4th ed. McGraw-Hill, 2006.
- F. J. Fabozzi and Steven V. Mann (Ed.),
The Handbook of Fixed Income Securities. 8th ed.
Irwin, 2012.
-
J. C. Hull,
Options, Futures, and Other Derivatives. 9th ed. Prentice-Hall, 2014.
- R. Jarrow
and S. Turnbull,
Derivative Securities.
2nd ed.
South-Western, 1999.
- S. N. Neftci, Principles of Financial Engineering. 2nd ed.
Academic Press, 2008.
- P.
Ritchken,
Derivative Markets: Theory, Strategy, and Applications.
HarperCollins, 1996.
- S. M. Sundaresan,
Fixed Income Markets and Their Derivatives. 3rd ed.
Academic Press, 2009.
- Articles
-
The Financial Modelers' Manifesto
-
Goldman Sachs Is a Tech Company (April 12, 2015)
-
The Medallion Fund, an Employees-Only Offering for the Quants at Renaissance Technologies, Is the Blackest Box in all of Finance (November 21, 2016)
-
The Most In-demand Programming Languages on Wall Street (January 28, 2015)
-
The Top Ten Technology Skills at BAML, Barclays, Credit Suisse, Citi, Goldman Sachs, JPMorgan, Morgan Stanley and UBS (April 16, 2015)
- Internet Resources
- Teaching Assistant(s)
- Software
To Students,
You will learn a perhaps different perspective on finance,
especially as it pertains to pricing and software engineering.
Our emphasis on computation should add a new dimension and
toolbox to your existing knowledge and financial sense.
(But see Enrollments below.)
It is your
responsibility to learn to write in high-level programming
languages. We cannot impart that skill in the class.
If the mathematics proves hard going, you are expected to
fill in the gap by self-reading. The technicalities are not
beyond a motivated graduate student's reach.
The major topics covered in the course, time permitting, are listed
below for your reference.
- Time value of money
- Bonds, mortgages, and annuities
- Duration, convexity, and
immunization
- Yield curve,
forward rate, and spot rate
- Option pricing theory
and its wide-ranging applications
- Black-Scholes analysis
- binomial option pricing model (BOPM)
- Futures,
forwards, and other derivatives
- The combinatorics of random walks
-
Martingale,
Brownian motion,
stochastic calculus, and
Ito integral
- Risk-neutral valuation
- Risk management
- Fixed-income securities with embedded options
and interest rate derivatives
- Mortgage-backed securities (MBS)
- Numerical methods
- Monte Carlo methods
- Variance reduction (efficiency-improving) techniques
- Least-squares technique
- Quasi-Monte Carlo method
- Solving partial differential equations
- Yield curve fitting
- GARCH models
- Interest rate models and
calibration
-
2022.02.18
-
2022.02.25
-
2022.03.04
-
2022.03.11
-
2022.03.18
& 1st assignment due
-
2022.03.25
-
2022.04.01
-
2022.04.08
-
2022.04.15
-
2022.04.22
& 2nd assignment due
-
2022.04.29
-
2022.05.06
-
2022.05.13
video 1
video 2
video 3
-
2022.05.20
& 3rd assignment due
video 1
video 2
video 3
-
2022.05.27
video 1
video 2
video 3
-
2022.06.03
-
2022.06.10 (optional)
video 1
video 2
video 3
-
2022.06.17
& 4th assignment due
Programming Exercises
Homework should be turned in on time. No late
homework will be accepted without legitimate reasons.
There will be four to six programming
assignments.
Treat each homework as an examination.
-
You are expected to write your own
codes and turn in your source code.
-
Do not copy or collaborate with fellow students.
-
Never ask your friends to write programs for you.
-
Never give your code to other students or publish your code because it may be copied
and you in turn may be suspected of copying other's code!
The graders will not attempt to sort out who the original coders are because we are not running a court here.
-
Do program carefully.
It is much more important to get the numbers right than to get a
pretty user interface running.
-
Write a program to generate an amortization schedule of repaying a loan.
Inputs:
(1) L (loan amount in dollars),
(2) r (interest rate in percent, for example, 12 instead of 0.12),
(3) n (duration of the loan in years), and
(4) m (how many payments per annum).
Output: A csv file for the amortization schedule.
The schedule shall have five columns:
(1) Time (0, 1, 2, ...),
(2) Payment (each payment amount),
(3) Interest (the interest part of each payment),
(4) Principal (the principal part of each payment), and
(5) Remaining principal.
Please check the example output file in here.
IMPORTANT notes:
(1) The Time column must be integers (no floating-point numbers).
(2) The Payment, Interest, Principal, and Remaining principal columns must be floating-point numbers up to 2 decimal points.
(3) The order of the columns must be respected.
(4) The headers of the columns must be as in the sample file.
(5) Start from Time 0 instead of Time 1. This means the value of the first row will be 0, 0, 0, 0, L.
Please send your source code, executable code, and a brief explanation file if necessary (e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of March 18, 2022.
No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_1 for easy reference. Example: R91922054_HW_1.
If Python is not your programming language
please demonstrate your code to 盧與明 during the office hour or make an appointment with him to do so.
(You still have to submit the files before the deadline.)
-
Write a binomial tree program to price a down-and-in partial barrier put. The barrier only exists from T/3 to T (inclusively), where T is the time to maturity.
Inputs:
(1) S (stock price),
(2) K (strike price),
(3) r (interest rate),
(4) s (volatility),
(5) T (time to maturity in number of days),
(6) H (barrier), and
(7) n (number of time steps per day).
Output: Option price.
For example, suppose that S = 95, K = 100, r = 10 (%), s = 25 (%), T = 200 (days), and H = 90. The put price is about 6.6237 at n = 3 and 6.6304 at n = 6.
IMPORTANT notes:
(1) The interest rate and volatility should be in percent. For example, if the interest rate is 1% and volatility 10%, the inputs are 1 and 10, respectively.
(2) The barrier level H may not be aligned with a level of tree nodes. In that case, use the highest price on the tree that is lower than H as the effective barrier.
(3) Assume 1 year has 365 days.
Please send your source code, executable code, and a brief explanation file if necessary
(e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM
of April 22, 2022.
No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_2 for easy reference. Example: R91922054_HW_2.
If Python is not your programming language, please demonstrate your code to 盧與明 during the office hour or make an appointment with him to do so.
(You still have to submit the files before the deadline.)
-
Implement the Brownian bridge approach to price a down-and-in partial barrier put. The barrier only exists from T/3 to T (inclusively), where T is the time to maturity.
Inputs:
(1) S (stock price),
(2) K (strike price),
(3) r (interest rate),
(4) s (volatility),
(5) T (time to maturity of days),
(6) H (barrier),
(7) n (number of time steps per day),
(8) N (number of simulation path).
Output: Option price and the standand error.
IMPORTANT notes:
(1) The interest rate and volatility should be in percent. For example, if the interest rate is 1% and volatility 10%, the inputs are 1 and 10, respectively.
(2) Assume 1 year has 365 days.
Please send your source code, executable code, and a brief explanation file if necessary
(e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM
of May 20, 2022.
No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_3 for easy reference. Example: R91922054_HW_2.
If Python is not your programming language, please demonstrate your code to 盧與明 during the office hour or make an appointment with him to do so.
(You still have to submit the files before the deadline.)
-
Calibrate the Black-Derman-Toy model to obtain the binomial interest rate tree.
Inputs:
(1) spot rates of riskless zero-coupon bonds (in percent),
(2) yield volatilities of the same bonds (in percent) except the first bond as its yield does not have volatility.
Output: the binomial interest rate tree.
For example, suppose the spot rates are 10, 11, 12, 12.5, and 13 (%) for
the 1-, 2-, 3-, 4-, and 5-year zero-coupon bonds, respectively,
and the yield volatilities are 19, 18, 17, and 16 (%)
for the 2-, 3-, 4-, 5-year zero-coupon bonds, respectively.
Then a binomial interest rate tree that matches both term structures appears here.
IMPORTANT notes:
(1) The spot rates and volatilities should be in percent. For example, if the spot rate is 1% and volatility 10%, they are inputted as 1 and 10, respectively.
(2) Your program should take two lines of input. The first line reads the spot rates and the second the yield volatilities.
(3) In each line of input, the numbers shall be separated by space.
(4) The times to matruities increment by one year.
So 10 11 12 means the spot rates for the 1, 2, and, 3 years are 10 (%), 11 (%), and 12 (%), respectively.
(5) Please print one line for each period of the binomial interest rate tree.
So the output of the first line is 10, the second line is 14.32 9.79, the third line is 19.42 13.77 9.76, etc.
Please send your source code, executable code, and a brief explanation file if necessary
(e.g., how to run it?) using the CEIBA system (CSIE 7134) before 08:00 AM of June 17, 2022.
No late submissions will be accepted. Compress your files into a single file and name it StudentID_HW_4 for easy reference. Example: R91922054_HW_4.
If Python is not your programming language, please demonstrate your code to 盧與明 during the office hour or make an appointment with him to do so.
(You still have to submit the files before the deadline, however.)
Enrollments
-
Non-programmers will be strongly discouraged
as the probability of passing this course is slim,
if possible at all.
-
It is not impossible to pick up programming skills before
the first assignment.
-
Financial knowledge is a plus, but again it can be picked up if you are motivated.