DSC 40A – Homework 5
Due: Friday, November 11 at 11:59pm
Write your solutions to the following problems by either typing them up or handwriting them on another
piece of paper. Homeworks are due to Gradescope by 11:00pm on the due date. You can use a slip day to
extend the deadline by 24 hours. Make sure to correctly assign pages to Gradescope when submitting.
Homework will be evaluated not only on the correctness of your answers, but on your ability to present
your ideas clearly and logically. You should always explain and justify your conclusions, using sound
reasoning. Your goal should be to convince the reader of your assertions. If a question does not require
explanation, it will be explicitly stated.
Homeworks should be written up and turned in by each student individually. You may talk to other
students in the class about the problems and discuss solution strategies, but you should not share any
written communication and you should not check answers with classmates. You can tell someone how to do
a homework problem, but you cannot show them how to do it.
For each problem you submit, you should cite your sources by including a list of names of other students
with whom you discussed the problem. Instructors do not need to be cited.
This homework will be graded out of 50 points. The point value of each problem or sub-problem is indicated
by the number of avocad
os shown.
Note: Problems 1 and 2 refer to a supplemental Jupyter Notebook, which can be found at this link.
Problem 1. Transformation Tuesday
The logistic function, also known as the “sigmoid” function, is defined as follows:
σ(x) =
1
1 + e x
The logistic function σ (has nothing to do with standard deviation) is used in a variety of fields. Pertinently,
it is used to model the growth of populations and spread of diseases. You’ll also see it later on in your data
science career when you learn about logistic regression.
a) Show that the inverse of the logistic function is given by
σ 1(x) = log
(
x
1 x
)
where log represents the natural logarithm with base e.
Hint: Recall, one strategy to find the inverse of a function y = f(x) is to write x = f ′(y) and solve
for y.
b) Note: Parts (b), (c), and (d) of this question should not take very much time; you’ve already
done the heavy lifting in part (a).
Suppose we have a dataset (x1, y1), (x2, y2), …, (xn, yn) and want to use least squares to fit a prediction
rule
H(x) = σ(w0 + w1x)
1
This is not linear in our parameters, w0 and w1. However, through a transformation, we can frame
it as a linear prediction rule.
Using the process from Lecture 10, transform H(x) into a prediction rule that is linear in terms of the
parameters w0 and w1. Specify a design matrix X and observation vector z such that the optimal w