Solutions for Homework 1 Introduction to Computational Finance Spring 2013
Problem 1.1
1.1.a
1.1.b
Explain why one should never test for oating point equality. Instead, one should test if two
numbers are almost equal. The basic test for two oating point n
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #1
0. Executive Summary
There are several problems being solved in this homework assignment, centralized around one common theme,
how dierent computers represent and perform operations on numerical v
Set 7: Least Squares
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Discrete Interpolation and Approximation
Given discrete values of f (x) and possibly some of its derivatives
ex
Set 10: Differentiation
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Derivatives
Given samples of an unknown function y(x)
(x0 , y0 ), (x1 , y1 ), . . . , (xn , yn )
estimate y (
Set 15: Partial Differential Equations
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Partial Differential Equations
An unknown function u is specied in terms of
Set 9: Composite and Adaptive Quadrature
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Newton-Cotes Composite Formulas
When b a is large or n is too large to trust a Newton-Cotes
Set 12: Ordinary Differential Equations Part
1
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Sources and References
U. Ascher and L. Petzold, Computer Methods fo
Set 11: Monte Carlo Quadrature
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Probability
A random variable, X, is a real number assigned to random event E.
The
Set 8: Newton-Cotes Quadrature
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Numerical Quadrature
Let f (x) C[a, b]. Numerical quadrature approximates the denite
integral
b
In (f )
Set 13: Ordinary Differential Equations Part
2
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Quadrature Approach Backward Euler
Using right rectangle rule quadrature, i.e., a const
Set 16: Numerical PDE Basics
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
A Simple Example
The diffusion equation
ut = uxx , x (, ),
u(0, x) = g(x)
is an initial
Set 14: Ordinary Differential Equations:
Stiffness
Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Stiffness: Stability vs. Accuracy
A-stable methods are neither always effective no
Set 17: Options and PDE Methods
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Scaling
Recall the generic advection diffusion equation:
ut + aux = uxx
and consider
Spring 2014
Introduction to Computational Finance
MAP 5611
Details
Time and Place : 11:15 12:05 , 201 Love Building
Instructor: K. A. Gallivan (5-0306, 318 Love Building, [email protected])
Homepage http:/www.math.fsu.edu/~gallivan
Oce Hours: 8:00
Set 1: Basics
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Finite Precision
All discussions so far have assumed we can compute with elements
of R and by extensi
Set 3: Solving Nonlinear Equations Part 1
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Value of an Account with Simple Interest
Dene a time interval to be T tim
Set 5: Interpolation Part 1
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Motivation
Volatility, , is a derived quantity.
It is inferred from stock prices.
van
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #3
0. Executive Summary
In this assignment there is a need to determine the minimal interest rate, i, at which a person can invest $1000
per month for 15 years to ensure retirement nest egg of $1 mil
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #4
0. Executive Summary
1
1. Statement of Problem
2
2. Description of the Mathematics
3
3. Description of the Algorithm
4
4. Results
5
5. Conclusion
6
APPENDIX: 1 Main le
#include <iostream>
using na
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #5
0. Executive Summary
In this assignment I developed a program which evaluates denite integrals given the intregrand f , the closed
interval [a, b], and a relative tolerance for the error. I will u
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #6
1. Show that once can approximate the intial value problem for y = F (t, y ) by
Yn+1 = Yn + t F (tn+1/2 , Yn+1/2 )
(1)
t
.
2
NOTE: For Midpoint Rule over [a, b]
where tn+1/2 = tn +
b
a+b
2
f (x)dx
Jaime Frade
Computational Finance: Dr. Kopriva
Homework #6
0. Executive Summary
In this assignment, there was a need to setup a program that calculated the value of an option using the
Black Scholes dierential equation. The method will be based on the Cra
A Note on Reporting Programming Assignment Results
When reporting your results for a programming assignment the following format is recommended. It comprises seven sections each of which provide a dierent level of detail of the
problem and its solution. Y
Set 16: Options and PDE Methods
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2013
1
Scaling
Recall the generic advection diffusion equation:
ut + aux = uxx
and consider
Solutions for Homework 2 Introduction to Computational Finance Spring 2013
Problem 2.1
Your programming task requires the use of an interpolatory cubic spline to solve a problem
concerning bonds.
A bond is purchased discounted from their value at maturity
Study Questions;Introduction to Computational Finance
Spring 2013
These are some additional questions to study before the Midterm Exam.
Problem 2.1
Suppose to solve for a root of f (x), i.e., f (x ) = 0, we use the iteration
xk+1 = (xk )
where (x) is a gi
Homework 4 Introduction to Computational Finance Spring
2013
Solutions due Friday, 4/5/13
Solutions to the programming tasks should be sent via email to [email protected]
before 11:59 PM on the due date. For problems with written solutions you may sca
Solutions Homework 5 Introduction to Computational
Finance Spring 2013
Answers to the homework problems should be sent via email to [email protected]
before 11:59 PM on the due date. For problems with written solutions you may scan handwritten solutio
Set 2: Stability
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Stability
Conditioning is a property of a problem that is independent of the
algorithm used to sol
Set 4: Solving Nonlinear Equations Part 2
David Kopriva and Kyle A. Gallivan
Department of Mathematics
Florida State University
Introduction to Computational Finance
Spring 2014
1
Order of a Method
We would like to do much better than the bisection metho