lecture_17

lecture_17 - BIOS 735: Statistical Computing Michael Wu...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
BIOS 735: Statistical Computing Michael Wu Lecture 17: Computer Arithmetic (2) and Omicron Notation October 11, 2011 Michael Wu (Lecture 17) BIOS 735 October 11, 2011 1 / 14
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Arithmetic: Example from Last Class We can use a taylor series if | x | is modest to find exp ( x ) = i 0 x i / i ! . fexp <- function(x) { i <- 0 expx <- 1 u <- 1 while(abs(u)>1.e-8 * abs(expx)) { i <- i+1 u <- u * x/i expx <- expx+u } expx } options(digits = 10) c(exp(10), fexp(10)) c(exp(100), fexp(100)) c(exp(-1), fexp(-1)) c(exp(-20), fexp(-20)) c(exp(-30), fexp(-30)) Michael Wu (Lecture 17) BIOS 735 October 11, 2011 2 / 14
Background image of page 2
Computer Arithmetic: Ill Conditioned Problems Ill conditioned problems are computing problems where small perturbations in the problem give large perturbations in the exact solution. Example: solving the system of equations A n × n x n × 1 = b n × 1 when A is nearly singular. It is essentially impossible to get precise solutions to this problem. Caution: The algorithm is the issue in the example from last class, not the inherent problem. Michael Wu (Lecture 17) BIOS 735 October 11, 2011 3 / 14
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Computer Arithmetic: Fixing the Example exp ( - x ) = 1 / exp ( x ) so we can instead: fexp <- function(x) { xa <- abs(x) i <- 0 expx <- 1 u <- 1 while(u>1.e-8 * expx) { i <- i+1 u <- u * xa/i expx <- expx+u } if (x >= 0) expx else 1/expx } c(exp(-1),fexp(-1)) c(exp(-30),fexp(-30)) c(exp(-100),fexp(-100)) The problem is ok, it was the algorithm that was bad. Michael Wu (Lecture 17) BIOS 735 October 11, 2011 4 / 14
Background image of page 4
Computer Arithmetic: Stability In contrast to conditioning which is inherent to the problem, and is irrespective of the algorithm, stability is with reference to the algorithm. Stability Let g ( x ) be the exact solution to a problem with input x , and g * ( x ) is the value computed by a particular algorithm. Then g * ( x ) can be thought of as the solution to a perturbed problem with inputs e
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

lecture_17 - BIOS 735: Statistical Computing Michael Wu...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online