ma cs 375 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
MA/CS 375 PowerPoint Presentation
Download Presentation
MA/CS 375

Loading in 2 Seconds...

play fullscreen
1 / 32

MA/CS 375 - PowerPoint PPT Presentation


  • 87 Views
  • Uploaded on

MA/CS 375. Fall 2002 Lecture 22. Interlude on Norms. We all know that the “size” of 2 is the same as the size of -2, namely: ||2|| = sqrt(2*2) = 2 ||-2|| = sqrt((-2)*(-2)) = 2 The ||..|| notation is known as the norm function. Norm of A Vector.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'MA/CS 375' - jocelyn-zimmerman


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
ma cs 375

MA/CS 375

Fall 2002

Lecture 22

MA/CS 375 Fall 2002

interlude on norms
Interlude on Norms
  • We all know that the “size” of 2 is the same as the size of -2, namely:
  • ||2|| = sqrt(2*2) = 2
  • ||-2|| = sqrt((-2)*(-2)) = 2
  • The ||..|| notation is known as the norm function.

MA/CS 375 Fall 2002

norm of a vector
Norm of A Vector
  • We can generalize the scalar norm to a vector norm, however now there are more choices for a vector :

MA/CS 375 Fall 2002

norm of a vector1
Norm of A Vector
  • Matlab command:
  • norm(x,1)
  • norm(x,2)
  • norm(x,inf)

MA/CS 375 Fall 2002

norm of a matrix
Norm of A Matrix
  • We can generalize the vector norm to a matrix norm, however now there are more choices for a matrix :
  • 1-norm maximum absolute column sum
  • infinity-norm, maximum absolute row sum

MA/CS 375 Fall 2002

norm of a matrix1
Norm of A Matrix
  • Matlab command:
  • norm(A,1)
  • norm(A,2)
  • norm(A,inf)
  • norm(A,’fro’)

MA/CS 375 Fall 2002

matrix norm in action
Matrix Norm in Action
  • Theorem 5: (page 185 van Loan)
    • If is the stored version of then where and

i.e. an error of order ||A||1eps occurs when

a real matrix is stored in floating point.

MA/CS 375 Fall 2002

condition number
Condition Number
  • Recall that when we asked Matlab to invert a matrix which was almost singular: we got this warning

MA/CS 375 Fall 2002

definition of condition number
Definition of Condition Number
  • rcond = 1/(condition number)
  • We are going to use the 1-norm definition of the condition number given as:

MA/CS 375 Fall 2002

what s with the condition number
What’s With The Condition Number ?
  • Theorem 6: (page 235 van Loan)
    • If is non-singular and: In addition if then the stored linear system: is nonsingular and also:

MA/CS 375 Fall 2002

in plain english
In Plain English
  • The theorem supposes that we can solve the Ax=b problem without making any mistakes except for the stored approximation of A and b then:
    • If the condition number is small enough, then the difference between the exact answer and the calculated answer will be bounded above by: const*condition#*eps
    • Matlab value of eps is approximately 1e-16
    • So if A has a condition number of 1 then we can expect to solve Ax=b to 16 decimal places at best
    • If A has a condition number of 1000 then in the worst case we could make an error of 1e-13
    • If A has a condition number of 10^16 then we could make O(1) errors

MA/CS 375 Fall 2002

cond in matlab
cond in Matlab
  • cond(A,1) will return the 1-norm condition number
  • cond(A,2) will return the 2-norm condition number

MA/CS 375 Fall 2002

team exercise
Team Exercise
  • Build
  • For delta=1,0.1,0.01,…,1e-16 compute:
    • cond(A,1)
  • Plot a loglog graph of the
    • x=delta, y=condition number
  • Figure out what is going on

MA/CS 375 Fall 2002

team exercise theory
Team Exercise (theory)

MA/CS 375 Fall 2002

team exercise theory1
Team Exercise (theory)

MA/CS 375 Fall 2002

team exercise theory2
Team Exercise (theory)

Pretty big huh 

Did your results concur?

MA/CS 375 Fall 2002

team exercise theory3
Team Exercise (theory)

Pretty big huh 

Remark: remember how when we set delta = 2^(-11) and we could actually get the exact inverse. Well in this case the condition number is a little pessimistic as a guide !.

MA/CS 375 Fall 2002

enough theory
Enough Theory !

MA/CS 375 Fall 2002

interpolation
Interpolation
  • Question:
    • someone gives you a function evaluated at 10 points, how does the the function behave between those 10 points?
  • Answer:
    • guesses

MA/CS 375 Fall 2002

interpolation1
Interpolation
  • Question:
    • someone gives you a function evaluated at 10 points, how does the the function behave between those 10 points?
  • Answer:
    • there is no unique answer,but we can make a good guess

MA/CS 375 Fall 2002

polynomial interpolation
Polynomial Interpolation
  • What’s the highest order unique polynomial that you can fit through a function evaluated at 1 point?
  • That would be a constant function with the same value as the given function value.

MA/CS 375 Fall 2002

polynomial interpolation1
Polynomial Interpolation
  • What’s the highest order unique polynomial that you can fit through a function evaluated at 2 points?
  • That would be a linear function that passes through the two values:

MA/CS 375 Fall 2002

linear interpolation
LinearInterpolation

MA/CS 375 Fall 2002

linear interpolation1
LinearInterpolation

exp(x)

Samples

Linear fit

MA/CS 375 Fall 2002

general monomial interpolation
General Monomial Interpolation
  • Given N function values at N distinct points then there is one unique polynomial which passes through these N points and has order (N-1)
  • Guess what – we can figure out the coefficients of this polynomial by solving a system of N equations 

MA/CS 375 Fall 2002

2 nd order polynomial fit
2nd Order Polynomial Fit
  • we are going to use a 2nd order approximation
  • let’s make sure that the approximation agrees with the sample at:
    • x1,x2 and x3

MA/CS 375 Fall 2002

2 nd order polynomial fit1
2nd Order Polynomial Fit
  • We know:
  • x1,x2 and x3
  • f(x1),f(x2) and f(x3)
  • We do not know:
  • a1,a2 and a3

MA/CS 375 Fall 2002

2 nd order polynomial fit2
2nd Order Polynomial Fit
  • We know:
  • x1,x2 and x3
  • f(x1),f(x2) and f(x3)
  • We do not know:
  • a1,a2 and a3

re-written as system

MA/CS 375 Fall 2002

finally a reason to solve a system
Finally A Reason To Solve A System

So we can build the

following then: a = V\f

MA/CS 375 Fall 2002

expansion coefficients
Expansion Coefficients
  • Once we have the coefficients a1,a2,a3 then we are able to evaluate the quadratic interpolating polynomial anywhere.

MA/CS 375 Fall 2002

class exercise
Class Exercise
  • Part 1:
    • Build a function called vandermonde.m which accepts a vector of x values and a polynomial order P
    • In the function find N=length of x
    • Function returns a matrix V which is Nx(P+1) and whose entries are:

V(n,m) = (xn)(m-1)

  • Part 2:
    • Translate this pseudo-code to Matlab a script:
    • for N=1:5:20
      • build x = set of N points in [-1,1]
      • build f = exp(x)
      • build xfine = set of 10N points in [-1,1]
      • build Vorig = vandermonde(N-1,x)
      • build Vfine = vandermonde(N-1,xfine)
      • build Finterp = Vfine*(Vorig\f);
      • plot x,f and xfine,Finterp on the same graph
    • end

MA/CS 375 Fall 2002

next lecture
Next Lecture
  • If you have a digital camera bring it in
  • If not, bring in some jpeg, gif or tif pictures (make sure they are appropriate)
  • We will use them to do some multi-dimensional interpolation
  • Estimates for accuracy of polynomial interpolation

MA/CS 375 Fall 2002