8.6 Exercises
Exercise 8.1 Determine if the following equations are linear with respect to the parameters. For the purposes of this problem we assume that \(y\) is a function of \(x\).
- \(y=a + bx+cx^{2}+dx^{3}\)
- \(y=a \sin (x) + b \cos (x)\)
- \(y = a \sin(bx) + c \cos(dx)\)
- \(y = a + bx + a\cdot b x^{2}\)
- \(y = a e^{-x} + b e^{x}\)
- \(y = a e^{-bx} + c e^{-dx}\)
Exercise 8.2 Each of the following equations can be written as linear with respect to the parameters, through applying some elementary transformations to the data. Write each equation as a linear function with respect to the parameters.
- \(y=ae^{-bx}\)
- \(y=(a+bx)^{2}\)
- \(\displaystyle y = \frac{1}{a+bx}\)
- \(y = c x^{n}\)
Exercise 8.3 Use the dataset global_temperature
and the function lm
to answer the following questions:
- Complete the following table, which represents various regression fits to global temperature \(T\) (in degrees Celsius) and years since 1880 (denoted by \(Y\)). In the table Coeffiicients represent the values of the parameters \(a\), \(b\), \(c\), etc from your fitted equation; P = number of parameters; RSE = Residual standard error.
Equation | Coefficients | P | RSE |
---|---|---|---|
\(T=a+bY\) | |||
\(T=a+bY+cY^{2}\) | |||
\(T=a+bY+cY^{2}+dY^{3}\) | |||
\(T=a+bY+cY^{2}+dY^{3}+eY^{4}\) | |||
\(T=a+bY+cY^{2}+dY^{3}+eY^{4}+fY^{5}\) | |||
\(T=a+bY+cY^{2}+dY^{3}+eY^{4}+fY^{5}+gY^{6}\) |
- After making this table, choose the polynomial of the function that you believe fits the data best. Provide reasoning and explanation why you chose the polynomial that you did.
- Finally show the plot of your selected polynomial with the data.
Exercise 8.4 An equation that relates a consumer’s nutrient content (denoted as \(y\)) to the nutrient content of food (denoted as \(x\)) is given by: \(\displaystyle y = c x^{1/\theta},\) where \(\theta \geq 1\) and \(c\) are both constants is a constant.
- Show that you can write this equation as linear equation by applying a logarithm to both sides and simplifying.
- Use the dataset
phosphorous
to determine a linear regression fit for your new linear equation. - Determine the value of \(c\) and \(\theta\) in the original equation with the parameters from the linear fit.
phosphorous
to the equation \(\displaystyle y = c x^{1/\theta},\) where \(\theta \geq 1\) and \(c\) are both constants is a constant. For a starting point, you may use the values of \(c\) and \(\theta\) from the previous exercise. Finally make a plot of the original phosophorous data and the fitted model.
Exercise 8.6 A common equation in enzyme kinetics is the Michaelis-Menten law, which states that the rate of the uptake of a substrate \(V\) is given by the equation:
\[\begin{equation} V = \frac{V_{max} s}{s+K_{m}}, \end{equation}\]
where \(s\) is the amount of substrate, \(K_{m}\) is half-saturation constant, and \(V_{max}\) the maximum reaction rate. (Typically \(V\) is used to signify the “velocity” of the reaction.)
Say you have the following data:
s (mM) | V (mM / s) |
---|---|
0.1 | 0.04 |
0.2 | 0.08 |
0.5 | 0.17 |
1.0 | 0.24 |
2.0 | 0.32 |
3.5 | 0.39 |
5.0 | 0.42 |
- Using algebra, show that this equation can be written as \(\displaystyle \frac{1}{V} = \frac{1}{V_{max}} + \frac{K_{m}}{V_{max}} \cdot \frac{1}{s}\)
- The text determined the fitted coefficients for these transformed data. Determine values of \(K_{m}\) and \(V_{max}\).
- Make a plot of the actual data to the fitted model curve you found.
Exercise 8.7 Following on from the last exercise, let’s do a nonlinear least squares fit of the enzyme data to the equation:
\[\begin{equation} V = \frac{V_{max} s}{s+K_{m}}, \end{equation}\]
where \(s\) is the amount of substrate, \(K_{m}\) is half-saturation constant, and \(V_{max}\) the maximum reaction rate.
- Determine a non-linear least squares fit to the data for the given equation. You may use the values of \(K_{m}\) and \(V_{max}\) that you determined in the last exercise.
- Make a plot of the actual data to the fitted model curve you found.
Exercise 8.8 Consider the following data which represents the temperature over the course of a day:
Hour | Temperature |
---|---|
0 | 54 |
1 | 53 |
2 | 55 |
3 | 54 |
4 | 58 |
5 | 58 |
6 | 61 |
7 | 63 |
8 | 67 |
9 | 66 |
10 | 67 |
11 | 69 |
12 | 68 |
13 | 68 |
14 | 66 |
15 | 67 |
16 | 63 |
17 | 60 |
18 | 59 |
19 | 57 |
20 | 56 |
21 | 53 |
22 | 52 |
23 | 54 |
24 | 53 |
- Make a scatterplot of these data, with the variable on the horizontal axis.
- A function that describes these data is \(\displaystyle T = A + B \sin \left( \frac{\pi}{12} \cdot H \right) + C \cos \left( \frac{\pi}{12} \cdot H \right)\), where \(H\) is the hour and \(T\) is the temperature. Explain why this equation is linear for the parameters \(A\), \(B\), and \(C\).
- Define a
tibble
that include the variables \(T\), \(\displaystyle \sin \left( \frac{\pi}{12} \cdot H \right)\) \(\displaystyle \cos \left( \frac{\pi}{12} \cdot H \right)\). - Do a linear fit on your new data frame to report the values of \(A\), \(B\), and \(C\).
- Add your fitted curve to the scatterplot.