1 Hands-On Exercises #6 (11 September 2013) 1.1 A – roots of polynomials Find the roots of these quadratic polynomials from H-O #1 using the R function uniroot. 1. f1 (x) = 6x2 − 11x + 4 2. f2 (x) = 4x2 − 13x + 3 3. f3 (x) = 2x2 − x − 6 And also the roots of this cubic: f4 (x) = x3 − 5x2 − 17x + 21 If the intervals are difficult to determine, recall that the roots of a function are separated by the roots of its derivatives. So 1. f10 (x) = 12x − 11 2. f20 (x) = 8x − 13 3. f30 (x) = 4x − 1 4. f40 (x) = 3x2 − 10x − 17 1.2 B – tricky root finding √ The function f5 (x) = x/ x2 + 1 has an obvious root at the origin. Try to confuse uniroot by giving it intervals that include 0 but get large. That is, try intervals of the form [−1, B] and try large values of B. 1.3 C – approximation problem A simple approximation to the square root of a number x in the interval [1/16, 1] is the function y(x) = 1.681595 − 1.288973/(.8408065 + x) √ √ √ Find the extreme points of either (y(x) − x)/ x or (y(x) − x)2 /x. 1.4 D – robust estimator of location Consider the estimate of location which minimizes n X f (µ) = |Yi − µ|3/2 1 as something between the mean (exponent 2) and median (exponent 1). Write a function with argument a vector y that creates f (µ) as its result. For the data Yi , i = 1, . . . , n taking the values 3, 5, 6, 8, 9, 12, 16, 22, minimize f (µ). jfm, 11 September 2013 1
© Copyright 2026 Paperzz