Chap 48 Review

\[ \newcommand{\dnorm}{\text{dnorm}} \newcommand{\pnorm}{\text{pnorm}} \newcommand{\recip}{\text{recip}} \]

Exercise 1 The two graphs below show the same set of knot points. The interpolating function in one graph is a cubic spline; in the other it is a quadratic spline.

  1. Which plot shows the cubic spline?
Function A       Function B      

question id: horse-wakes-stove-1

  1. What is it about the shapes of the two interpolating functions that motivated your answer to (1)?

question id: horse-wake-stove-2

Exercise 2 Referring to to the spline in XREF not implemented yet, explain what it means to say, “The cubic spline respects the monotonicity of consecutive knot points.”

question id: chicken-cut-gloves-1

Exercise 3 The dots plotted by the R code in ?lst-elephant-fight-ship show Johannes Kepler’s calculated distance of Mars from the Sun using Tycho Brahe’s observational data.

Three interpolating functions are drawn through the data points:

  1. A cubic spline
  2. A global polynomial
  3. A simple sinusoid with a period of 687 days.
Active R chunk 1
  1. Which of the curves is the sinusoid?
black       dodgerblue       green      

question id: elephant-fight-ship-1

  1. Which of the curves is the global polynomial?
black       dodgerblue       green      

question id: elephant-fight-ship-2

  1. How smooth is the global polynomial? (There 28 data points.)
\(C^2\)       \(C^3\)       \(C^{27}\)       \(C^\infty\)      

question id: elephant-fight-ship-3

  1. How smooth is the cubic spline? (There 28 data knots.)
\(C^2\)       \(C^3\)       \(C^{27}\)       \(C^\infty\)      

question id: elephant-fight-ship-4

Just for interest: The observations are in small clusters of points separated by large gaps. This is because to make an observation, Mars had to be visible from Earth on at least two occasions separated by the orbital period of Mars: 687 days. There were no observations when Mars wasn’t visible from Tycho Brahe’s observatory in Denmark, as happens whenever the line segment between Earth and Mars passes near the Sun.

The sinusoidal oscillation in the orbital radius of Mars reflects the eccentricy of the orbit; it is an ellipse rather than a circle. Neither the cubic spline nor the global polynomial do a creditable job tracking the actual orbit of Mars. That is because neither method has a way to “discover” that the data are periodic, which is a huge hint about the sorts of functions that are appropriate.

Now, a trick. We will compute for each time a phase of that time in the 687 day orbit. This will collapse all the data down to the interval \(0 \leq t < 687\). Active R chunk 2 wil plot the data and the interpolating functions.

Active R chunk 2

With the data spaced more evenly over the orbital cycle, both the cubic spline and the polynomial provide a smooth match to the data, while the sinusoid shows systematic deviations.

Exercise 4 These questions are just about R/mosaic code reading skills. They refer to the example about Kepler’s analysis of the orbit of Mars found in Exercise 3.

  1. The data are stored in an object named Kepler. What kind of object is Kepler?
A data frame       A matrix       A vector       A function      

question id: ash-fly-canoe-1

  1. There are two variables from Kepler’s data used in the code. What are their names?
time and angle       distance and angle       kepler.radius and kepler.angle       kepler.distance and kepler.angle      

question id: ash-fly-canoe-2

  1. The object connector is defined on lines 2 and 3 of the sandbox code. What kind of R object is connector? (Hint, you may need to read further along in the code to figure this out.)
A data frame       A number       A vector       A function      

question id: ash-fly-canoe-3

  1. What kind of R object is kepler.radius ~ kepler.angle?
A tilde expression       An arithmetic expression       A function       A character string      

question id: ash-fly-canoe-4

  1. The R function gf_point() as used here has how many arguments?
1       2       3       4      

question id: ash-fly-canoe-5

  1. What’s the give away that polynomial (as used here) is a function?

The name polynomial is followed by open and close parentheses.

The name polynomial begins with a p.

The name polynomial is an English verb.

question id: ash-fly-canoe-6

  1. Why are there quotation marks in 'red'?

Because the color is only sort of red-ish, not pure red.

Because Mars is the “Red Planet”

Because the word is a literal set of characters, not the name of a function or other R object.

question id: ash-fly-canoe-7

No answers yet collected