Tutorial 5
Q1. Using the same approach as was employed to derive the equations shown below,
𝑛Σ𝑥𝑖 𝑦𝑖 − Σ𝑥𝑖 Σ𝑦𝑖
𝑎1 =
𝑛Σ𝑥𝑖2 − (Σ𝑥𝑖 )2
𝑎𝑜 = 𝑦̅ − 𝑎1 𝑥̅
, derive the least-squares fit for the following model:
𝑦 = 𝑎1 𝑥 + 𝜀
That is, determine the slope that results from the least-squares calculation for a straight line
with zero intercept. Fit the following data with this model
X 2 4 6 7 10 11 14 17 20
Y 4 5 6 5 8 8 6 9 12
Answer: 𝒚 = 𝟎. 𝟔𝟏𝟒𝟒𝒙
Q2. Use least-squares regression to fit a straight line to the data
X 0 2 4 6 9 11 12 15 17 19
Y 5 6 7 6 9 8 8 10 12 12
Along with the slope and intercept, compute the standard error of the estimate and the
coefficient of determination R2. Then repeat the calculations switching the two variables.
Interpret your results
Answer:
𝒚 = 𝟒. 𝟖𝟖𝟖𝟔 + 𝟎. 𝟑𝟓𝟗𝟏𝒙
𝑺𝒚/𝒙 = 𝟎. 𝟖𝟓𝟏𝟏
𝑹𝟐 = 𝟎. 𝟖𝟗𝟑
𝒚 = −𝟏𝟏. 𝟏𝟑𝟒𝟔 + 𝟐. 𝟒𝟖𝟔𝟏𝒙
𝑺𝒚/𝒙 = 𝟐. 𝟐𝟑𝟗𝟑
𝑹𝟐 = 𝟎. 𝟖𝟗𝟑
Note that the R 2 value is the same in both cases.
The second application is evidently not proper because y is not deterministic, i.e., noise-
free.
Q3. Fit a power model to the data from table below, but use the natural logarithm for the
transformation of the data
Experiment data for drag force (N) and velocity (m/s) from a wind tunnel experiment
v, m/s 10 20 30 40 50 60 70 80
F,N 25 70 380 550 610 1220 830 1450
Answer
𝒚 = 𝟎. 𝟐𝟕𝟒𝟏𝒙𝟏.𝟗𝟖𝟒𝟐
Q4. Beyond the examples in figure below, there are other models that can be linearized using
transformation. Here is one:
𝑦 = 𝛼4 𝑥𝑒 𝛽4 𝑥
Linearize this model and use it to estimate 𝛼4 and 𝛽4 based on the following data.
x 0.1 0.2 0.4 0.6 0.9 1.3 1.5 1.7 1.8
y 0.75 1.25 1.45 1.25 0.85 0.55 0.35 0.28 0.18
Answer:
𝒚 = 𝟗. 𝟔𝟓𝟒𝟑𝒙𝒆−𝟐.𝟒𝟕𝟐𝟔𝒙
Q5. A transportation engineering study was conducted to determine the proper design of bicycle
lanes. Data were gathered on bike lane widths and average distance between bikes and
passing cars. The data from nine streets are:
Distance,m 2.4 1.5 2.4 1.8 1.8 2.9 1.2 3 1.2
Lane 2.9 2.1 2.3 2.1 1.8 2.7 1.5 2.9 1.5
Width,m
a. Plot the data. Make any observations
b. Fit a straight line to the data using regression. Add this line to the plot
c. If the minimum safe distance between bikes and passing cars is to be 2 meters,
determine the design width of the bike lane.
Answer:
𝒚 = 𝟎. 𝟕𝟏𝟔𝟕 + 𝟎. 𝟕𝟑𝟓𝟓𝒙
Y=2.1877 m