7.9 Exercises

Conceptual

  1. It was mentioned in this chapter that a cubic regression spline with one knot at ξ can be obtained using a basis of the form x , x[2] , x[3] , ( 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 + β 1 x + β 2 x[2] + β 3 x[3] + β 4( x − ξ )[3] +

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

(a) Find a cubic polynomial

\[f_1(x) = a_1 + b_1 x + c_1 x^2 + d_1 x^3\]

such that f ( x ) = f 1( x ) for all x ≤ ξ . Express a 1 , b 1 , c 1 , d 1 in terms of β 0 , β 1 , β 2 , β 3 , β 4.

(b) Find a cubic polynomial

\[f_2(x) = a_2 + b_2 x + c_2 x^2 + d_2 x^3\]

such that f ( x ) = f 2( x ) for all x > ξ . Express a 2 , b 2 , c 2 , d 2 in terms of β 0 , β 1 , β 2 , β 3 , β 4. We have now established that f ( x ) is a piecewise polynomial.

(c) Show that f 1( ξ ) = f 2( ξ ). That is, f ( x ) is continuous at ξ . (d) Show that f 1 [′][(] [ξ][) =] [ f][ ′] 2[(] [ξ][)][.][That][is,] [f][ ′][(] [x][)][is][continuous][at] [ξ][.] (e) Show that f 1 [′′][(] [ξ][) =] [ f][ ′′] 2[(] [ξ][)][.][That][is,] [f][ ′′][(] [x][)][is][continuous][at] [ξ][.]

Therefore, f ( x ) is indeed a cubic spline.

Hint: Parts (d) and (e) of this problem require knowledge of singlevariable calculus. As a reminder, given a cubic polynomial

\[f(x) = ax^3 + bx^2 + cx + d\]

the first derivative takes the form

\[f'(x) = 3ax^2 + 2bx + c\]

and the second derivative takes the form

\[f''(x) = 6ax + 2b\]
  1. Suppose that a curve g ˆ is computed to smoothly fit a set of n points using the following formula:
\[\sum_{i=1}^n \left( y_i - \hat{g}(x_i) \right)^2 + \lambda \int \left[ \hat{g}^{(m)}(t) \right]^2 dt\]

where g[(] [m][)] represents the m th derivative of g (and g[(0)] = g ). Provide example sketches of g ˆ in each of the following scenarios.

(a) λ = ∞, m = 0.

(b) λ = ∞, m = 1.

(c) λ = ∞, m = 2.

(d) λ = ∞, m = 3.

(e) λ = 0 , m = 3.

  1. Suppose we fit a curve with basis functions b 1( X ) = X , b 2( X ) = ( X − 1)[2] I ( X ≥ 1). (Note that I ( X ≥ 1) equals 1 for X ≥ 1 and 0 otherwise.) We fit the linear regression model
\[Y = \beta_0 + \beta_1 X + \beta_2 X^2 + \epsilon\]

and obtain coefficient estimates β[ˆ] 0 = 1 , β[ˆ] 1 = 1 , β[ˆ] 2 = 2. Sketch the estimated curve between X = 2 and X = 2. Note the intercepts, slopes, and other relevant information.

  1. Suppose we fit a curve with basis functions b 1( X ) = I (0 ≤ X ≤ 2) ( X − 1) I (1 ≤ X ≤ 2), b 2( X ) = ( X − 3) I (3 ≤ X ≤ 4)+ I (4 < X ≤ 5). We fit the linear regression model
\[Y = \beta_0 + \beta_1 X + \beta_2 X^2 + \epsilon\]

and obtain coefficient estimates β[ˆ] 0 = 1 , β[ˆ] 1 = 1 , β[ˆ] 2 = 3. Sketch the estimated curve between X = 2 and X = 6. Note the intercepts, slopes, and other relevant information.

  1. Consider two curves, g ˆ1 and g ˆ2, defined by
\[\begin{align*} \hat{g}_1 &= \arg \min_g \left( \dots \right) \\ \hat{g}_2 &= \arg \min_g \left( \dots \right) \end{align*}\]

where g[(] [m][)] represents the m th derivative of g .

  • (a) As λ →∞ , will g ˆ1 or g ˆ2 have the smaller training RSS?

  • (b) As λ →∞ , will g ˆ1 or g ˆ2 have the smaller test RSS?

  • (c) For λ = 0, will g ˆ1 or g ˆ2 have the smaller training and test RSS?

7.9 Exercises 327


Sub-Chapters (하위 목차)

Applied (현실 비선형 도메인 예측 응용 데이터 코드 시나리오 모델링 통계 문제 해결 풀이장)

정규화/비정규화된 현업 혹은 경제 데이터와 기상 데이터 베이스 시나리오 등을 유사 응용 데이터 파이프라인으로 로딩 마운트하고 K-Fold 체계를 접목해 나만의 분석 모델 함수 커스텀을 직접 세팅한 뒤 어떻게 최적의 K수량 노드 매듭점 파라미터 수치값을 찾아 개선 곡면 예측 지표 체계로 만들 수 있는지 스스로 주피터 환경에서 코드를 완성 서브밋하고 결과 통계치를 유의미하게 탐구 제출할 수 있습니다.

서브목차