Assignment 5 Solution

$29.99 $18.99

Problem 1 [25%] It is mentioned in Chapter 7 of ISL that a cubic regression spline with one knot at ξ can be obtained using a basis of the form x, x2, x3, [x − ξ]3+, where [x − ξ]3+ = (x − ξ)3 if x > ξ and equals 0 otherwise. We will now…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

Rate this product

Problem 1 [25%]

It is mentioned in Chapter 7 of ISL that a cubic regression spline with one knot at ξ can be obtained using a basis of the form x, x2, x3, [xξ]3+, where [xξ]3+ = (xξ)3 if x > ξ and equals 0 otherwise. We will now show that a function of the form

f(x) = β0 + β1x + β2x2 + β3x3 + β4[x ξ]3+

is indeed a cubic regression spline, regardless of the values of β0,β1,β2, β3,β4.

1. Find a cubic polynomial

f1(x) = a1 + b1x + c1x2 + d1x3

such that f(x) = f1(x) for all xξ. Express a1,b1,c1,d1 in terms of β0,β1,β2,β3,β4.

2. Find a cubic polynomial

f2(x) = a2 + b2x + c2x2 + d2x3

such that f(x) = f2(x) for all x > ξ. Express a2,b2,c2,d2 in terms of β0,β1,β2,β3,β4. We have now established that f(x) is a piecewise polynomial.

3. Show that f1(ξ) = f2(ξ). That is, f(x) is continuous at ξ.

Problem 2 [25%]

Use linear, cubic, and natural regression splines investigated Chapter 7 of ISL to the Auto data set. Is there evidence for non-linear relationships in this data set? Create some informative plots to justify your answer.

Problem 3 [25%]

You will now derive the Bayesian connection to the lasso as discussed in Section 6.2.2. of ISL.

Problem 4 [25%]

Based on a true story, according to: The Drunkard’s Walk: How Randomness Rules Our Lives, Leonard Mlodinow

Suppose that you applied for a life insurance and underwent a physical exam. The bad news is that your application was rejected because you tested positive for HIV. The test’s sensitivity is 99.7% and specificity is 98.5% [https://en.wikipedia.org/wiki/Diagnosis_of_HIV/AIDS#Accuracy_of_HIV_testing]. However, after studying the CDC website, you find that in your ethnic group (age, gender, race, . . . ) only one in 10,000 people is infected. What is the probability that you actually have HIV?

2