Question: Solve using R or SAS Exercise Consider Newton's method to find a minimum or maximum value attained by a function over an interval. Given a
Solve using R or SAS

Exercise Consider Newton's method to find a minimum or maximum value attained by a function over an interval. Given a function f, we wish to find max f(x) E[a, b] Start with an initial guess, xo, then generate a sequence of guesses using the formula Ck+1 = Ck f' (ack ) f" (xk ) where f' and f" are first and second derivatives. We won't be finding derivatives analytically, instead, we will be using numerical approximations (central finite differences), given by f' ~ f ( 2 + 2 ) - f(x - 2) h f" ~ f( + h) - 2f(2) +f(x-h) h2 where h is some arbitrary small value. We will work with likelihood function L(x; M, 62) = he ( 3 - 14 ) 2 202 . Let u = m1936 be the mean Calories per Serving from 1936, and let o = $1936 be the corresponding standard deviation. We will wish to find the x* that maximizes max L(x; m1936, $1936) Let the initial guess be xo = 180 and let h = 0.1. Calculate 10 successive Ck, saving each value in a vector. Print the final xk. Why does this value maximize the likelihood function? Part b. Plot the sequence of x versus iteration number () as the independent variable. Add a horizontal line corresponding to M1936. How many iterations are required until lack+1 - Xk|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
