Fin500J: Mathematical Foundations in Finance Topic 3: Numerical Methods for Solving Non-linear Equations Philip H. Dybvig Reference: Numerical Methods.

Slides:



Advertisements
Similar presentations
Part 2 Chapter 6 Roots: Open Methods
Advertisements

Lecture 5 Newton-Raphson Method
CSE 330: Numerical Methods
Optimisation The general problem: Want to minimise some function F(x) subject to constraints, a i (x) = 0, i=1,2,…,m 1 b i (x)  0, i=1,2,…,m 2 where x.
Regula-Falsi Method. Type of Algorithm (Equation Solver) The Regula-Falsi Method (sometimes called the False Position Method) is a method used to find.
Open Methods Chapter 6 The Islamic University of Gaza
Open Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 7 Roots of Equations Bracketing Methods.
Chapter 4 Roots of Equations
Chapter 6 Open Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 6 Roots of Equations Bracketing Methods.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 9 Roots of Equations Open Methods.
Solution of Nonlinear Equations: Lecture (I)
Lectures on Numerical Methods 1 Numerical Methods Charudatt Kadolkar Copyright 2000 © Charudatt Kadolkar.
Dr. Marco A. Arocha Aug,  “Roots” problems occur when some function f can be written in terms of one or more dependent variables x, where the.
NUMERICAL METHODS WITH C++ PROGRAMMING
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 8 Roots of Equations Open Methods.
Bracketing Methods Chapter 5 The Islamic University of Gaza
Chapter 3 Root Finding.
Section 5.5 – The Real Zeros of a Rational Function
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Roots of Equations Chapter 3. Roots of Equations Also called “zeroes” of the equation –A value x such that f(x) = 0 Extremely important in applications.
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 8. Nonlinear equations.
Solving Non-Linear Equations (Root Finding)
Fin500J Topic 6Fall 2010 Olin Business School 1 Fin500J: Mathematical Foundations in Finance Topic 6: Ordinary Differential Equations Philip H. Dybvig.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Numerical Methods Applications of Loops: The power of MATLAB Mathematics + Coding 1.
Fin500J: Mathematical Foundations in Finance
1 Nonlinear Equations Jyun-Ming Chen. 2 Contents Bisection False Position Newton Quasi-Newton Inverse Interpolation Method Comparison.
Lecture 6 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
Lecture 3 Bisection method Download bisection02.m And ftest2.m From math.unm.edu/~plushnik/375.
1 Solution of Nonlinear Equation Dr. Asaf Varol
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
Numerical Methods for Engineering MECN 3500
EE:211 Computational Techniques in Electrical Engineering Lecture#2
Numerical Methods.
Numerical Methods Root Finding 4. Fixed-Point Iteration---- Successive Approximation Many problems also take on the specialized form: g(x)=x, where we.
Newton’s Method, Root Finding with MATLAB and Excel
Today’s class Roots of equation Finish up incremental search
MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
ROOTS OF EQUATIONS. Bracketing Methods The Bisection Method The False-Position Method Open Methods Simple Fixed-Point Iteration The Secant Method.
Lecture 5 - Single Variable Problems CVEN 302 June 12, 2002.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 7 Roots of Polynomials.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 5 Bracketing Methods.
Solving Non-Linear Equations (Root Finding)
Numerical Methods Solution of Equation.
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
4 Numerical Methods Root Finding Secant Method Modified Secant
Recursive Methods for Finding Roots of Functions Bisection & Newton’s Method.
4 Numerical Methods Root Finding.
6/13/ Secant Method Computer Engineering Majors Authors: Autar Kaw, Jai Paul
CSE 330: Numerical Methods. What is true error? True error is the difference between the true value (also called the exact value) and the approximate.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
MATH342: Numerical Analysis Sunjae Kim.
CSE 330: Numerical Methods. Introduction The bisection and false position method require bracketing of the root by two guesses Such methods are called.
Solution of Nonlinear Equations ( Root Finding Problems )
4 Numerical Methods Root Finding Secant Method Modified Secant
Solution of Nonlinear Equations (Root finding Problems
Numerical Methods and Analysis
Newton’s Method for Systems of Non Linear Equations
Read Chapters 5 and 6 of the textbook
MATH 2140 Numerical Methods
Important Values for Continuous functions
Computers in Civil Engineering 53:081 Spring 2003
Intermediate Value Theorem
SOLUTION OF NONLINEAR EQUATIONS
Intermediate Value Theorem
4 Numerical Methods Root Finding.
ROOTS OF EQUATIONS.
Solutions for Nonlinear Equations
Presentation transcript:

Fin500J: Mathematical Foundations in Finance Topic 3: Numerical Methods for Solving Non-linear Equations Philip H. Dybvig Reference: Numerical Methods for Engineers, Chapra and Canale, chapter 5, and Dr. Samir Al-Amer’s Lecture Notes Slides designed by Yajun Wang Fin500J Topic 3Fall 2010 Olin Business School 1

Solution Methods Several ways to solve nonlinear equations are possible. Analytical Solutions possible for special equations only Graphical Illustration Useful for providing initial guesses for other methods Numerical Solutions Open methods Bracketing methods Fin500J Topic 3Fall 2010 Olin Business School 2

Solution Methods: Analytical Solutions Analytical solutions are available for special equations only. Fin500J Topic 3Fall 2010 Olin Business School 3

Graphical Illustration Graphical illustration are useful to provide an initial guess to be used by other methods Fin500J Topic 3Fall 2010 Olin Business School 4 Root

Bracketing/Open Methods In bracketing methods, the method starts with an interval that contains the root and a procedure is used to obtain a smaller interval containing the root. Examples of bracketing methods : Bisection method In the open methods, the method starts with one or more initial guess points. In each iteration a new guess of the root is obtained. Fin500J Topic 3Fall 2010 Olin Business School 5

Solution Methods Many methods are available to solve nonlinear equations  Bisection Method  Newton’s Method  Secant Method False position Method Muller’s Method Bairstow’s Method Fixed point iterations ………. Fin500J Topic 3Fall 2010 Olin Business School 6 These will be covered.

Bisection Method The Bisection method is one of the simplest methods to find a zero of a nonlinear function. To use the Bisection method, one needs an initial interval that is known to contain a zero of the function. The method systematically reduces the interval. It does this by dividing the interval into two equal parts, performs a simple test and based on the result of the test half of the interval is thrown away. The procedure is repeated until the desired interval size is obtained. Fin500J Topic 3Fall 2010 Olin Business School 7

Intermediate Value Theorem Let f(x) be defined on the interval [a,b], Intermediate value theorem: if a function is continuous and f(a) and f(b) have different signs then the function has at least one zero in the interval [a,b] Fin500J Topic 3Fall 2010 Olin Business School 8 ab f(a) f(b)

Bisection Algorithm Assumptions: f(x) is continuous on [a,b] f(a) f(b) < 0 Algorithm: Loop 1. Compute the mid point c=(a+b)/2 2. Evaluate f(c ) 3. If f(a) f(c) < 0 then new interval [a, c] If f(a) f( c) > 0 then new interval [c, b] End loop Fin500J Topic 3Fall 2010 Olin Business School 9 a b f(a) f(b) c

Bisection Method Assumptions: Given an interval [a,b] f(x) is continuous on [a,b] f(a) and f(b) have opposite signs. These assumptions ensures the existence of at least one zero in the interval [a,b] and the bisection method can be used to obtain a smaller interval that contains the zero. Fin500J Topic 3Fall 2010 Olin Business School 10

Bisection Method Fin500J Topic 3Fall 2010 Olin Business School 11 a0a0 b0b0 a1a1 a2a2

Flow chart of Bisection Method Fin500J Topic 3Fall 2010 Olin Business School 12 Start: Given a,b and ε u = f(a) ; v = f(b) c = (a+b) /2 ; w = f(c) is u w <0 a=c; u= wb=c; v= w is (b-a)/2 <ε yes no Stop no

Example: Answer: Fin500J Topic 3Fall 2010 Olin Business School 13

Stopping Criteria Two common stopping criteria 1. Stop after a fixed number of iterations 2. Stop when Fin500J Topic 3Fall 2010 Olin Business School 14

Example Use Bisection method to find a root of the equation x = cos (x) with (b-a)/2 n+1 <0.02 (assume the initial interval [0.5,0.9]) Fin500J Topic 3Fall 2010 Olin Business School 15 Question 1: What is f (x) ? Question 2: Are the assumptions satisfied ?

Fin500J Topic 3Fall 2010 Olin Business School 16

Bisection Method Initial Interval Fin500J Topic 3Fall 2010 Olin Business School 17 a =0.5 c= 0.7 b= 0.9 f(a)= f(b) =0.2784

Fin500J Topic 3Fall 2010 Olin Business School ( )/2 = ( )/2 = 0.05

Fin500J Topic 3Fall 2010 Olin Business School ( )/2= ( )/2=.0125

Summary Initial interval containing the root [0.5,0.9] After 4 iterations Interval containing the root [0.725,0.75] Best estimate of the root is | Error | < Fin500J Topic 3Fall 2010 Olin Business School 20

Bisection Method Programming in Matlab a=.5; b=.9; u=a-cos(a); v= b-cos(b); for i=1:5 c=(a+b)/2 fc=c-cos(c) if u*fc<0 b=c ; v=fc; else a=c; u=fc; end Fin500J Topic 3Fall 2010 Olin Business School 21 c = fc = c = fc = c = fc = c = fc =

Newton-Raphson Method (also known as Newton’s Method) Given an initial guess of the root x 0, Newton-Raphson method uses information about the function and its derivative at that point to find a better guess of the root. Assumptions: f (x) is continuous and first derivative is known An initial guess x 0 such that f ’(x 0 ) ≠0 is given Fin500J Topic 3Fall 2010 Olin Business School 22

Newton’s Method Fin500J Topic 3Fall 2010 Olin Business School 23 X i+1 X i

Example Fin500J Topic 3Fall 2010 Olin Business School 24 FN.m FNP.m

Results Fin500J Topic 3Fall 2010 Olin Business School 25 X = FNX = X = FNX =2.4495e-004 X = FNX =6.9278e-009

Secant Method Fin500J Topic 3Fall 2010 Olin Business School 26

Secant Method Fin500J Topic 3Fall 2010 Olin Business School 27

Example Fin500J Topic 3Fall 2010 Olin Business School 28

Example Fin500J Topic 3Fall 2010 Olin Business School 29

Results Fin500J Topic 3Fall 2010 Olin Business School 30 Xi = -1 FXi =1 Xi = FXi = Xi = FXi = Xi = FXi =8.1695e-005 Xi = FXi =1.1276e-007

Summary Bisection Reliable, Slow One function evaluation per iteration Needs an interval [a,b] containing the root, f(a) f(b)<0 No knowledge of derivative is needed Newton Fast (if near the root) but may diverge Two function evaluation per iteration Needs derivative and an initial guess x 0, f ’ (x 0 ) is nonzero Secant Fast (slower than Newton) but may diverge one function evaluation per iteration Needs two initial guess points x 0, x 1 such that f (x 0 )- f (x 1 ) is nonzero. No knowledge of derivative is needed Fin500J Topic 3Fall 2010 Olin Business School 31

Solving Non-linear Equation using Matlab Fin500J Topic 3Fall 2010 Olin Business School 32 Example (i): find a root of f(x)=x-cos x, in [0,1] >> x-cos(x); >> fzero(f,[0,1]) ans = Example (ii): find a root of f(x)=e -x -x using the initial point x=1 >> exp(-x)-x; >> fzero(f,1) ans =

Solving Non-linear Equation using Matlab Fin500J Topic 3Fall 2010 Olin Business School 33 Example (iii): find a root of f(x)=x 5 +x 3 +3 around -1 >> x^5+x^3+3; >> fzero(f,-1) ans = Because this function is a polynomial, we can find other roots >> roots([ ]) ans = i i i i

Use fzero Solver in Matlab Fin500J Topic 3Fall 2010 Olin Business School 34 >>optimtool For example: want to find a root around -1 for x 5 +x 3 +3=0 The algorithm of fzero uses a combination of bisection, secant, etc.