Compile a list of 121 hourly temperatures over five consecutive days from a weather data website. Let x0=0:6:120 denote hours, and y0 denote the temperatures at hours 0,6,12,…,120. Carry out steps (a)–(c) of Computer Problem 14, suitably adapted.
Computer Problem 14
Compile a list of 101 consecutive daily close prices of an exchange-traded stock from a financial data website. (a) Plot the interpolating polynomial through every fifth point. That is, let x0=0:5:100 and y0 denote the stock prices on days 0,5,10,…,100. Plot the degree 20 interpolating polynomial at points x=0:1:100 and compare with the daily price data. What is the maximum interpolation error? Is the Runge phenomenon evident in your plot? (b) Plot the natural cubic spline with interpolating nodes 0:5:100 instead of the interpolating polynomial, along with the daily data. Answer the same two questions. (c) Compare the two approaches of representing the data.