0% found this document useful (0 votes)
8 views2 pages

Exercise 6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Exercise 6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ConREM Master Programme

Helsinki Metropolia University of Applied Sciences / HTW Berlin


Advanced Mathematical Methods in Economics and Management

Exercise 6: Introduction to curve fitting, regression and Excel’s Solver

To be reported to the Oma workspace of the course by Monday 18.11.

The report (it can be an Excel file) should include also verbal explanations, in addition to calculations. Also
remember to answer all questions which require verbal answers.

1. A mountain hiker walked from coast to the mountains and measured air temperature in different
altitudes. The results are below. Let’s make an unrealistic assumption that the hiker walks very quickly
(so that sun is not setting during the hike) and weather is stable, when the decrease in temperature is
mainly caused by change in altitude.

alt. ( km ) temp. ( C )
0,0 37,7
0,5 34,3
1,0 25,0
1,5 23,2
2,0 14,3
2,5 11,1
3,0 8,8

a) Create a scatter plot of the data in Excel. Fit a line to the data, using Add Trendline tool. Set the
equation and the R-squared value to be shown in the graph.

b) Add Trendline tool has option “Forecast”. Use it to predict the temperature in higher altitudes. If
assuming that the same linear model can be used, what would be the temperature on the top of Mont
Blanc (4810 m) ?

c) Try different models with Add Trendline: polynomials of degree 2, 3, 4 and so on. What happens to
R-squared value (and why)? What about the predicted temperature on the top of Mont Blanc? What
about the predictions based on different polynomials?

d) Fit 2nd degree polynomial to the data using Excel’s Solver (and using the method of least squares).
Is the solution the same as in point c ?

2. Fit a function of form 𝑦 = 𝑎 ⋅ √𝑥 + 𝑏 ⋅ 𝑥 + 𝑐 to the data below. Use Excel’s Solver.


x | 0.5 0.9 1.2 1.5 1.7 2.4 3.0
y | 0.21 0.05 0.07 0.08 0.13 0.42 0.75

Additional voluntary problem: Solve the same problem with matrix algebra, using Matlab software or
similar free software Gnu Octave, which you can install on your own laptop from website
https://www.gnu.org/software/octave/ . Find the parameters a, b and c using Matlab/Octave and the
method based on matrices and formula
𝑋 = (𝐴𝑇 𝐴)−1 𝐴𝑇 𝐵
Make a graph of observed and modelled data. The solving process is very similar to the one in file
curve_fitting.m.
3.
a) The data below is to be modelled with function 𝑦 = 𝑎 ⋅ 𝑥 𝑏 + 𝑐. Using Solver and the method of
least squares, find optimal values for parameters 𝑎, 𝑏 and 𝑐.

x 0,2 0,6 1 1,4 1,8 2,2 2,6 3 3,4 3,8 4,2 4,6
y 11 33 41 89 155 203 335 469 599 775 1035 1299

Can this problem be solved Add Trendline tool?

b) Using the same idea as in file Simple_Linear_Regression.xlsx, determine R-squared value in this
case.

4.

a) Study example file Regression_of_several_variables.xlsx. Then open file Sales_data.xlsx.

b) Applying regression, try to explain variable Salary by variable Sales (this is one-variable regression,
but use Regression tool in Data Analysis toolpak).

c) Then find out how well variable Sales can be explained by


1) variable “Average kilometers“ only
2) two variables “Average kilometers“ and “Telephone bills etc“.
3) three variables “Average kilometers“, “Telephone bills etc“ and “Customer satisfaction
score“

Observe how the R-square value changes. When the number of variables is increased it’s better to use
Adjusted R Square which considers also the number of variables. Ordinary R-square value always
improves (or sometimes stays unchanged) when new variables are added, even if the variables had
nothing to do with the variable to be explained.

d) There is one sales agent whose numbers seem to be somewhat contradictory. How the results of
point b (especially case b3) are changed if data of this sales agent is removed and regression
analysis is repeated? Tell about your observations in your report.

You might also like