MATH-05 · ALGEBRA

일차·이차함수와 모형의 오차Linear and quadratic functions; model error

선을 읽고, 관측과의 차이를 계산하고, 다른 기간에서 비교하기Read curves, calculate discrepancies and evaluate another period

실습 3종 · 풀이 포함 연습문제 12개3 labs · 12 exercises with solutions

기초Foundations

1. 관측을 정확히 지나는 선도 틀릴 수 있다1. A line through observations can still miss other observations

앞 장에서 첫 두 펭귄 관측을 잇는 h(x)=1.94+0.01x를 만들었습니다. 길이 x의 단위는 mm, 출력은 kg입니다. 두 행에서는 맞지만 세 번째 행에서는 3.89kg을 예측해 실제 3.25kg보다 0.64kg 큽니다. 관측 두 개를 정확히 맞췄다는 성질과 다른 관측을 잘 설명한다는 성질은 다릅니다.

모형은 질문에 필요한 관계를 남겨 계산 가능한 규칙으로 표현한 것입니다. 이 장은 일차·이차함수를 읽고, 예측과 관측의 차이를 수치로 요약합니다. 그런 뒤 실제 주택지수의 앞 기간으로 만든 식을 뒤 기간과 비교합니다. 수식을 복잡하게 만드는 것보다 어떤 자료로 만들고 어디에서 평가했는지를 먼저 봅니다.

The previous chapter's line h(x)=1.94+0.01x passes through the first two penguin observations, with length in mm and mass in kg. At row 3 it predicts 3.89kg rather than 3.25kg, an overprediction of 0.64kg. Exact agreement on two observations differs from useful agreement elsewhere.

A model retains relationships needed for a question and expresses them as a calculable rule. Read linear and quadratic functions, summarize observed discrepancies, then compare rules built on earlier property-index observations with later observations. Start with the construction and evaluation data, rather than complexity alone.

기초Foundations

2. 일차함수의 기울기와 절편을 단위로 읽기2. Read slopes and intercepts with units

일차함수 y=a+bx에서 x가 1만큼 늘면 출력은 b만큼 늘어납니다. y가 kg, x가 mm라면 b는 kg/mm입니다. a는 x=0일 때의 출력입니다. 하지만 x=0이 관측 범위 밖이라면 a를 실제 펭귄의 몸무게라고 해석할 근거는 없습니다.

원점 대신 관측에 가까운 200mm를 기준으로 z=x−200이라 두면 식을 읽기 쉽습니다. y=a+bz에서 a는 x=200mm일 때의 예측이고, b는 여전히 1mm 차이에 대한 kg 차이입니다. 기준을 바꾸는 것이 관측을 바꾸거나 새 정보를 만드는 것은 아닙니다.

m^(x)=4.156282+0.049686(x−200)\widehat m(x)=4.156282+0.049686(x-200)

위는 질량·길이가 모두 있는 342행에 최소제곱으로 맞춘 일차식의 반올림 표시입니다. 계산은 더 많은 자릿수를 사용합니다. x=210이면 약 4.653kg입니다. 길이 10mm 차이에 예측이 약 0.497kg 달라진다는 뜻이지, 날개를 늘리는 개입이 그만큼 질량을 늘린다는 인과 주장은 아닙니다.

For y=a+bx, increasing x by one changes the output by b. With y in kg and x in mm, b has units kg/mm. The intercept a is the output at x=0; if zero lies outside the observed range, it is not an established physical mass.

Use a reference near the observations by setting z=x−200. In y=a+bz, a predicts mass at 200mm and b still measures kg per mm. Shifting the reference changes the parameter interpretation without creating new observations.

m^(x)=4.156282+0.049686(x−200)\widehat m(x)=4.156282+0.049686(x-200)

This is the rounded least-squares line fitted to 342 complete pairs; calculations retain more digits. At 210mm the prediction is approximately 4.653kg. A 10mm difference corresponds to about 0.497kg in this rule, not an established causal effect of changing a wing.

기초Foundations

3. 잔차는 실제 값에서 예측을 뺀다3. A residual subtracts prediction from observation

관측값 y와 예측값 ŷ의 차이를 e=y−ŷ라고 정의합시다. 모형 작성에 사용한 관측에서 이 차이를 잔차라고 부릅니다. 양수이면 모형이 작게 예측했고, 음수이면 크게 예측했습니다. 원인을 모르더라도 차이는 직접 계산할 수 있습니다.

ei=yi−y^ie_i=y_i-\widehat y_i

처음 두 행으로 정한 직선을 세 번째 행에 적용하면 3.25−3.89=−0.64kg입니다. 음수라는 표시를 지우면 과대·과소 예측의 방향을 잃습니다. 반대로 부호 있는 오차를 단순히 더하면 큰 양수와 큰 음수가 상쇄되어, 맞지 않는 모형이 잘 맞는 것처럼 보일 수 있습니다.

통계 모형의 관측되지 않는 오차항과 계산된 잔차는 같은 개념이 아닙니다. 이 장에서 직접 확인하는 것은 선택한 식에 대한 관측값의 차이입니다. 그 차이를 전부 측정 실수라고 단정하지 마세요. 종·성별·개체 차이, 빠진 변수와 모형의 형태 등이 함께 관련될 수 있습니다.

Define e=y−ŷ. On observations used to fit a rule, this discrepancy is a residual. Positive means underprediction; negative means overprediction. It is calculable without already knowing why the discrepancy arose.

ei=yi−y^ie_i=y_i-\widehat y_i

The first-two-row rule gives 3.25−3.89=−0.64kg for row 3. The sign preserves the direction of error. Simply summing signed discrepancies can hide poor agreement because positive and negative values cancel.

A fitted residual differs from an unobserved statistical error term. Here we calculate differences from a chosen expression, not establish that all discrepancies are measurement mistakes. Species, individual variation, omitted variables and functional form may matter.

기초Foundations

4. 차이를 하나의 점수로 요약하기4. Summarize discrepancies with a score

오차의 크기를 보려면 절댓값을 평균하거나, 제곱을 평균한 뒤 제곱근을 씁니다. 절댓값은 부호를 떼어 크기를 읽는 연산입니다. 제곱은 큰 오차에 더 큰 무게를 줍니다. Σ는 관측별 항을 모두 더하라는 기호이며 n은 사용한 관측 수입니다.

MAE⁡=1n∑i=1n∣ei∣,RMSE⁡=1n∑i=1nei2\operatorname{MAE}=\frac1n\sum_{i=1}^n|e_i|,\qquad \operatorname{RMSE}=\sqrt{\frac1n\sum_{i=1}^n e_i^2}

처음 두 행 직선에 대한 첫 세 행의 차이는 0, 0, −0.64kg입니다. MAE는 0.64/3≈0.213kg, RMSE는 √(0.4096/3)≈0.370kg입니다. 0.4096의 단위는 kg²이며 제곱근을 취하면 kg로 돌아옵니다. kg를 g으로 바꾸면 MAE와 RMSE의 수치는 1000배가 됩니다.

좋은 점수의 기준은 질문에 달려 있습니다. 큰 오차를 특히 무겁게 보는지, 평균적인 절대 차이를 보고 싶은지 먼저 정하세요. 점수 하나가 인과 설명·공정성·모든 집단의 성능을 대신하지 않습니다. 같은 자료와 단위에서 비교하는지도 확인해야 합니다.

Average absolute errors or take the square root of mean squared errors. Absolute value reads magnitude without sign; squaring emphasizes large discrepancies. The symbol Σ adds the observation-level terms, and n is their count.

MAE⁡=1n∑i=1n∣ei∣,RMSE⁡=1n∑i=1nei2\operatorname{MAE}=\frac1n\sum_{i=1}^n|e_i|,\qquad \operatorname{RMSE}=\sqrt{\frac1n\sum_{i=1}^n e_i^2}

The first three discrepancies for the first-two-row rule are 0, 0 and −0.64kg. MAE is approximately 0.213kg and RMSE approximately 0.370kg. Squared error 0.4096 has units kg²; the square root restores kg. Converting kg to g multiplies both MAE and RMSE by 1000.

Choose the score for the question: are large misses especially costly, or is a typical absolute discrepancy more relevant? One score does not replace causal interpretation, fairness or subgroup performance. Keep comparison samples and units consistent.

기초Foundations

5. 이차항이 더해지면 변화량도 달라진다5. A quadratic term changes the increments

이차함수 a+bz+cz²에서는 같은 크기의 입력 변화에도 출력 변화가 달라집니다. c=0이면 일차식입니다. c>0인 경우 기본적인 그릇 모양, c<0이면 뒤집힌 모양이 됩니다. z²이 들어 있다고 모든 관측 현상의 실제 원리가 이차식이라는 뜻은 아닙니다.

f(z+Δ)−f(z)=bΔ+c(2zΔ+Δ2)f(z+\Delta)-f(z)=b\Delta+c(2z\Delta+\Delta^2)

오른쪽에는 원래 위치 z도 들어 있습니다. 따라서 “10mm 늘면 항상 같은 질량 변화”라는 일차식의 성질이 달라집니다. 342행에 맞춘 이차식은 약 4.051093+0.046033z+0.000548z²이고 z=x−200입니다. 계수의 단위도 각각 kg, kg/mm, kg/mm²로 맞아야 합니다.

꼭짓점의 위치는 c≠0일 때 z=−b/(2c)입니다. 완전제곱으로 식을 다시 써 확인할 수 있습니다. 꼭짓점이 관측 범위 밖에 있으면 그 점을 실제 개체의 최소 질량이라고 해석하지 마세요. 다음 실습에서 두 모형의 곡선과 오차를 같은 관측 위에서 비교합니다.

For a+bz+cz², equal input increments need not give equal output increments. Setting c=0 recovers a line. A positive c bends upward; a negative c bends downward. A quadratic expression is a chosen approximation, not automatically the physical law behind the observations.

f(z+Δ)−f(z)=bΔ+c(2zΔ+Δ2)f(z+\Delta)-f(z)=b\Delta+c(2z\Delta+\Delta^2)

The increment depends on the starting position z. The fitted quadratic for 342 pairs is approximately 4.051093+0.046033z+0.000548z², with z=x−200. Coefficient units are kg, kg/mm and kg/mm².

For nonzero c, completing the square locates the vertex at z=−b/(2c). A vertex outside the observed range is not an established minimum physical mass. Compare curves and discrepancies on the same observations in the lab.

심화Extension

6. 심화: 최소제곱 기울기는 어디서 올까?6. Extension: where does the least-squares slope come from?

최소제곱은 관측과 식의 제곱 차이 합을 가장 작게 만드는 계수를 찾습니다. 통계적 추론을 하기 전에 유한한 수들의 대수 문제로 볼 수 있습니다. 관측 평균을 x̄, ȳ라 하고 uᵢ=xᵢ−x̄, vᵢ=yᵢ−ȳ로 중심을 옮깁니다. 고정한 b에서 최선의 절편은 a=ȳ−bx̄입니다.

tᵢ=yᵢ−bxᵢ로 놓으면 그 이유가 보입니다. Σ(tᵢ−a)²=Σ(tᵢ−t̄)²+n(a−t̄)²이고, 교차항은 Σ(tᵢ−t̄)=0이어서 사라집니다. 첫 항은 a와 무관하고 둘째 항은 a=t̄에서 0이므로 a=ȳ−bx̄입니다. 이제 기울기만 고르면 됩니다.

S(b)=∑(vi−bui)2=∑vi2−2b∑uivi+b2∑ui2S(b)=\sum(v_i-bu_i)^2=\sum v_i^2-2b\sum u_iv_i+b^2\sum u_i^2

Sₓₓ=Σuᵢ²가 양수라면 마지막 식은 b에 대한 이차식입니다. 완전제곱으로 묶으면 b=Σuᵢvᵢ/Σuᵢ²일 때 최소가 됩니다. x가 모두 같으면 Sₓₓ=0이어서 기울기 하나를 이 방식으로 정할 수 없습니다. 식에 숫자를 넣기 전에 이 조건을 확인해야 합니다.

S(b)=S(b^)+Sxx(b−b^)2,b^=∑uivi∑ui2S(b)=S(\widehat b)+S_{xx}(b-\widehat b)^2,\quad \widehat b=\frac{\sum u_iv_i}{\sum u_i^2}

이 증명은 선택한 관측들의 제곱 차이를 최소화한다는 성질만 보입니다. 계수가 모집단의 참값인지, 통계적으로 유의한지, 원인 효과인지까지 증명한 것은 아닙니다. 그 질문들은 통계학·계량경제학에서 가정을 더해 다룹니다. 아직 Σ와 완전제곱이 낯설다면 이 절을 뒤에 다시 읽어도 됩니다.

Least squares minimizes the sum of squared observation-to-rule discrepancies. First view it as finite algebra. Center the data using uᵢ=xᵢ−x̄ and vᵢ=yᵢ−ȳ. For a fixed slope b, the optimal intercept is a=ȳ−bx̄.

To see why, set tᵢ=yᵢ−bxᵢ. Then Σ(tᵢ−a)²=Σ(tᵢ−t̄)²+n(a−t̄)²: the cross term vanishes because centered values sum to zero. Only the second term depends on a and it vanishes at a=t̄=ȳ−bx̄. We can now choose the slope.

S(b)=∑(vi−bui)2=∑vi2−2b∑uivi+b2∑ui2S(b)=\sum(v_i-bu_i)^2=\sum v_i^2-2b\sum u_iv_i+b^2\sum u_i^2

If Sₓₓ=Σuᵢ²>0, completing the square gives the minimizing slope Σuᵢvᵢ/Σuᵢ². When every x is equal, Sₓₓ=0 and this calculation cannot uniquely identify a slope.

S(b)=S(b^)+Sxx(b−b^)2,b^=∑uivi∑ui2S(b)=S(\widehat b)+S_{xx}(b-\widehat b)^2,\quad \widehat b=\frac{\sum u_iv_i}{\sum u_i^2}

The proof establishes optimal squared agreement for the chosen observations. It does not establish population truth, statistical significance or causality; those questions require additional assumptions. Return later if summation and completing the square are unfamiliar.

기초Foundations

7. Case study: 앞 기간으로 만든 식을 뒤에서 평가하기7. Case study: evaluate a rule on later observations

한국 명목 주택지수 사본을 1980-Q1–2019-Q4의 160분기와 2020-Q1–2024-Q4의 20분기로 나눕니다. 첫 기간에서 계수를 정하고, 두 번째 기간은 계산에 넣지 않은 채 예측과 비교합니다. 시간의 순서를 섞어 미래 값을 과거 모형 작성에 넣지 않습니다.

z는 2010-Q1에서 몇 년 떨어졌는지를 나타냅니다. 1분기는 0.25년입니다. 예를 들어 2024-Q4는 z=14.75입니다. 일차식과 이차식은 같은 앞 160관측으로 맞춥니다. 이 단순한 시간 추세식에는 금리·공급·소득 같은 설명 변수가 없으므로, 시간 기울기를 가격의 인과 원인이라고 부르면 안 됩니다.

이 사본에서는 일차식의 앞 기간 RMSE가 약 6.696, 보류기간 RMSE가 16.381지수포인트입니다. 이차식은 각각 6.599와 13.331입니다. 이 두 후보와 이 구간에서는 이차식이 작았습니다. 이 결과만으로 모든 구간이나 미래에 이차식이 가장 좋다는 결론은 나오지 않습니다.

Split the Korean nominal property-index copy into 160 quarters from 1980 Q1 to 2019 Q4 and 20 later quarters from 2020 Q1 to 2024 Q4. Estimate coefficients on the first period, then compare predictions with later observations excluded from estimation. Preserve chronological order.

Let z measure years from 2010 Q1; one quarter is 0.25 years, so 2024 Q4 has z=14.75. Fit the line and quadratic to the same 160 observations. These time trends omit interest rates, supply and income; a time coefficient is not a causal price driver.

The line has training RMSE approximately 6.696 and held-out RMSE 16.381 index points. The quadratic gives 6.599 and 13.331. Among these candidates on this period, the quadratic scores lower. This does not establish superiority in every period or in the future.

기초Foundations

8. 평가한 자료를 다시 쓰면 질문이 바뀐다8. Reusing evaluation data changes its role

보류기간 그래프를 보고 계수를 고치거나 후보를 계속 늘리면, 그 기간도 모형 선택에 사용한 셈이 됩니다. 마지막 성능을 새 자료에서 알고 싶다면 손대지 않은 다른 기간이나 순차 평가가 더 필요합니다. 이 실습의 보류구간은 개념을 배우는 회고적 비교이며 모형의 최종 인증이 아닙니다.

또한 이번 파일은 2026년에 내려받은 고정 사본입니다. 2019년 말 당시 공개된 수치의 빈티지를 복원한 자료는 아닙니다. 과거 시점에서 실제로 알 수 있었던 정보만 사용한 평가를 하려면 공개일·개정 이력까지 따로 확보해야 합니다.

모형마다 행을 다르게 골라 놓고 점수를 바로 비교하는 것도 피해야 합니다. 같은 대상·기간·단위에서, 어떤 값을 예측했고 어떤 관측으로 점수를 계산했는지를 기록하세요. 전체 평균이 좋아도 특정 종이나 시점에서는 크게 틀릴 수 있으므로 잔차 그림도 함께 봅니다.

If inspection of the held-out graph leads to changing coefficients or adding candidates, that period has entered model selection. A fresh final assessment needs untouched data or an appropriate sequential design. This lab is a retrospective teaching comparison, not a final model certification.

The file is a fixed download from 2026, not a reconstruction of the exact data release available in late 2019. A real-time historical evaluation also needs release dates and revision vintages.

Compare the same targets, periods and units. Record which observations construct the rule and which score it. An overall mean score can conceal large misses for a species or period, so inspect residual patterns too.

기초Foundations

9. 경영 의사결정에서 모형의 질문을 명확히 하기9. State the decision question before choosing a model

예측이 필요하다는 말만으로 좋은 모형이 정해지지 않습니다. 가정한 재고 관리 사례에서 부족 재고의 비용과 남는 재고의 비용이 다르면 두 방향의 오차를 같은 무게로 처리하는 점수가 실제 의사결정 목표와 맞지 않을 수 있습니다. 이는 손실함수의 의미를 생각하는 가정 사례이며 특정 기업의 자료는 아닙니다.

실제 펭귄 자료에서도 “한 관측의 질량 예측”과 “종별 평균 설명”은 서로 다른 목표입니다. 종별 차이를 모두 무시한 하나의 곡선을 만들어 예측 점수를 얻을 수는 있지만, 그것만으로 개체의 생물학적 구조를 충분히 설명했다고 말할 수 없습니다.

보고서의 첫 줄에는 대상·입력·출력·사용 시점·평가 기준을 적으세요. 숫자가 매끄럽게 나오는 식보다 다른 사람이 무엇을 검토해야 하는지 알 수 있는 모형이 연구와 실무에서 더 점검하기 쉽습니다.

A request for prediction does not define the best model. In an assumed inventory scenario, stockout and surplus costs may differ, so a symmetric error score may not match the decision objective. This illustrates loss design rather than measured results for a company.

Predicting an individual penguin's mass differs from describing species means. A pooled curve can obtain a score without adequately explaining biological differences among groups.

Begin a report with target, inputs, output, information date and scoring rule. A clearly specified model makes its evidence and assumptions easier to examine.

기초Foundations

10. 식·오차·평가 구간을 재현하기10. Reproduce expressions, errors and evaluation periods

동반 코드는 중심화한 입력으로 일차·이차식을 맞추고, 앞 160·뒤 20분기의 MAE·RMSE를 따로 계산합니다. Python의 작은 선형방정식 풀이와 R의 lm 결과를 대조합니다. 지금 선형대수 알고리즘을 외울 필요는 없으며, 여기서는 입력·출력·평가 구간이 같은지 확인하는 것이 우선입니다.

분석 과제: 두 곡선의 식과 계수 단위를 쓰고, 선택한 실제 한 행의 잔차를 손으로 계산하세요. 주택지수 앞·뒤 기간 점수를 비교한 표를 만들고, 결과가 달라지는 이유로 무엇을 추가 확인할지 세 가지를 적으세요. 점수만 보고 특정 경제정책의 효과를 주장하지 마세요.

The companions fit centered linear and quadratic rules and separately calculate MAE/RMSE for the 160 earlier and 20 later quarters. Compare a small Python linear-system implementation with R's lm. Memorizing the solver is unnecessary here; verify inputs, outputs and evaluation periods first.

Assignment: state both expressions and coefficient units; calculate one actual residual by hand; tabulate the period-specific scores; and list three further checks needed to interpret their differences. Scores alone do not establish economic policy effects.

Python·R 코드 실행 방법Run the Python/R companions

자료 묶음을 풀고 코드와 실제데이터 폴더를 함께 두세요. 터미널에서 코드 파일이 있는 폴더로 이동해 아래 명령을 실행합니다. 코딩이 처음이라면 손계산과 웹 실습을 먼저 하고, 데이터 사이언스 입문에서 코드를 배운 뒤 돌아와도 됩니다.Extract the bundle, keeping the scripts beside the data folder. In a terminal, enter the script folder and run the commands below. Beginners can complete hand calculations and browser labs first, returning to code after studying introductory data science.

python math05-reproduce.py
Rscript --vanilla --encoding=UTF-8 math05-reproduce.R

결과 파일은 각 코드에 지정된 결과 폴더에 저장됩니다. CSV 원자료는 덮어쓰지 않습니다.Result files are saved in the result directory specified by each script; the input CSVs are not overwritten.

영상·학자·함께 읽기Videos, thinkers and guided reading

본문의 질문을 넓히는 선택 학습입니다. 영상을 보기 전 질문을 먼저 읽고, 자신의 답을 쓴 뒤 해설과 비교하세요. 자료의 언어·선수 지식은 각 항목에 표시했습니다.Optional extensions to the chapter. Read the question first, write your answer, then compare with the explanation. Language and prerequisites are indicated below.

유튜브 · 직선을 맞춘다는 것YouTube · What fitting a line means

StatQuest with Josh Starmer · Linear Regression (2022)

공식 설명의 1:12–4:00 “Review of how to fit a line” 구간을 먼저 보세요. 영어 영상입니다. 뒤의 R²·p값은 통계학에서 추론을 배운 뒤 읽어도 됩니다. 전체 영상을 이미 이해해야 할 필요는 없습니다.Start with the official-description segment 1:12–4:00, “Review of how to fit a line.” This is in English. Return to R² and p-values after statistical inference.

교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.

보고 읽은 뒤 답하기Respond after watching/reading 첫 두 펭귄을 정확히 잇는 선과 전체 342행에 맞춘 선이 왜 다를까요? “정확히 지나는 점의 수”와 “전체 제곱 차이”로 설명하세요.Why does the line through two penguins differ from the fit to 342 rows? Compare exact interpolation with total squared discrepancies.

생각을 점검하는 해설Check your reasoning

두 점 직선은 두 행의 일치만 보장합니다. 최소제곱은 사용한 전체 관측의 제곱 차이 합을 줄이는 다른 목표입니다. 모든 관측을 지날 필요는 없습니다.The two-point line guarantees agreement on two rows. Least squares instead minimizes a total across the fitted sample and need not interpolate each point.

경제학자 · 얀 틴베르헌Economist · Jan Tinbergen

NobelPrize.org · The Use of Models: Experience and Prospects (1969)

틴베르헌의 강연 도입부는 변수를 정하고 관계를 모형으로 쓰며 자료로 검토하는 과정을 다룹니다. “식이 있다”에서 “무엇을 검증했는가”로 질문을 넓혀 보세요. 심화 읽기이며 원문 전체 이해는 이 장의 필수 조건이 아닙니다.The lecture opens with selecting variables, expressing relationships and examining models against data. Move from “there is an equation” to “what was tested?” This is optional advanced reading.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 펭귄 질량 모형에서 종을 빼면 어떤 한계가 생기나요? 새 변수를 추가했을 때 평가를 다시 해야 하는 이유는 무엇인가요?What can omitting species miss in a penguin model? Why must an expanded model be evaluated again?

생각을 점검하는 해설Check your reasoning

같은 길이의 질량 차이 일부가 종별 차이와 관련될 수 있습니다. 변수 추가가 모든 자료에서 개선을 보장하지 않으므로 별도 평가와 해석이 필요합니다.Species may relate to mass differences at the same length. Adding a variable does not guarantee improvement on all samples; evaluate and interpret the expanded rule.

함께 읽기 · 예측 정확도 평가Read together · Evaluating forecast accuracy

Hyndman & Athanasopoulos · 예측: 원리와 실제 §3.4

한국어의 훈련·테스트 자료 구분과 MAE·RMSE 부분부터 읽으세요. 이 장에서는 앞 160분기와 뒤 20분기를 어느 단계에서 쓰는지 표시해 보세요.Start with the Korean discussion of training/test data and MAE/RMSE. Mark when our earlier 160 and later 20 quarters enter the analysis.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 뒤 20분기 결과를 여러 번 보고 모형을 바꿨다면, 그 구간을 마지막의 독립 평가로 계속 부를 수 있나요?After repeatedly inspecting the later 20 quarters to change a model, can that interval still serve as an untouched final evaluation?

생각을 점검하는 해설Check your reasoning

그 구간이 선택에 영향을 주었습니다. 최종 성능을 별도로 평가하려면 선택에 쓰지 않은 새 관측이나 정해 둔 평가 절차가 필요합니다.It has informed model selection. Final assessment needs observations not used in those choices or a pre-specified evaluation procedure.

연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof

먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.

1. 기울기 단위Slope units

질량 kg를 길이 mm로 예측하는 기울기의 단위는?

What units does the slope use for kg predicted from mm?

풀이와 확인할 이유Solution and explanation

kg/mm다. 입력 1mm 차이에 대한 예측 kg 차이를 나타낸다.

kg/mm: predicted kilograms per millimetre.

2. 중심 기준Centered intercept

z=x−200일 때 a+bz의 절편 a는 무엇인가?

Interpret a in a+b(x−200).

풀이와 확인할 이유Solution and explanation

길이 200mm에서의 예측 kg다. 원래 x=0의 예측으로 읽으면 안 된다.

Predicted kilograms at 200mm, not at zero length.

3. 잔차 부호Residual sign

실제 3.25kg, 예측 3.89kg의 잔차와 방향은?

Find the residual for observed 3.25kg and predicted 3.89kg.

풀이와 확인할 이유Solution and explanation

−0.64kg이고 모형이 실제보다 크게 예측했다.

−0.64kg; the model overpredicts.

4. 상쇄Cancellation

가정한 오차 −2,+2의 평균이 0이면 완벽한가?

Do assumed errors −2,+2 give a perfect model because their mean is zero?

풀이와 확인할 이유Solution and explanation

아니다. MAE=2, RMSE=2다. 부호 있는 오차의 상쇄가 크기 2의 차이를 숨겼다.

No. MAE and RMSE both equal 2.

5. 단위 변환Scale conversion

kg 오차를 g으로 바꾸면 RMSE와 제곱오차 합은?

Convert errors from kg to g. How do RMSE and squared-error sum scale?

풀이와 확인할 이유Solution and explanation

RMSE는 1000배, 제곱오차 합은 1000²=백만 배다.

RMSE scales by 1000; the squared-error sum by one million.

6. 이차 증가량Quadratic increments

가정 f(z)=z²에서 f(3)−f(2), f(4)−f(3)은?

For f(z)=z², find successive increments from 2 to 3 and 3 to 4.

풀이와 확인할 이유Solution and explanation

각각 5와 7이다. 같은 입력 증가량 1에도 출력 차이가 달라진다.

They are 5 and 7.

7. 꼭짓점Vertex

가정 f(z)=2+4z+z²을 완전제곱으로 쓰고 최소 위치를 찾아라.

Complete the square for 2+4z+z².

풀이와 확인할 이유Solution and explanation

(z+2)²−2이므로 z=−2에서 최소 −2다. 실제 자료 모형이라면 허용 범위 안인지 별도로 확인한다.

(z+2)²−2, minimized at z=−2 if that input is permitted.

8. 기울기 불능Constant input

모든 관측의 x가 같으면 최소제곱 기울기 공식은 왜 쓸 수 없는가?

Why is the slope formula unavailable when all x values coincide?

풀이와 확인할 이유Solution and explanation

Σ(xᵢ−x̄)²=0이어서 분모가 0이다. 기울기와 절편을 하나로 구별할 정보가 부족하다.

Its denominator is zero; the inputs cannot distinguish a unique slope and intercept.

9. 관측 수Held-out count

앞 160분기와 뒤 20분기를 사용한 모형 비교에서 전체 180분기로 먼저 맞추면?

What if coefficients are estimated on all 180 quarters first?

풀이와 확인할 이유Solution and explanation

뒤 20분기를 계수 추정에 사용했으므로 같은 의미의 보류평가가 아니다.

The later 20 entered estimation, so they are no longer held out in the same sense.

10. 실제 점수 읽기Read actual scores

보류 RMSE 16.381과 13.331에서 무엇까지 말할 수 있는가?

What do held-out RMSE values 16.381 and 13.331 establish?

풀이와 확인할 이유Solution and explanation

같은 사본·구간·점수에서는 두 후보 중 이차식의 오차가 작았다. 모든 미래와 다른 후보까지 우월하다는 증명은 아니다.

For these candidates and this period, the quadratic scores lower; no universal ranking follows.

11. 빈티지Data vintage

2026년 다운로드 사본을 나눈 평가가 2019년 실제 예측을 완전히 재현하는가?

Does a split of a 2026 download exactly recreate a 2019 real-time forecast?

풀이와 확인할 이유Solution and explanation

아니다. 당시 공개일과 개정 전 자료를 확보한 빈티지 평가가 필요하다.

No. That also requires release and revision-vintage information.

12. 최소성 증명Minimum proof

S(b)=S(b̂)+Sₓₓ(b−b̂)²에서 Sₓₓ>0이면 최소점이 왜 b̂인가?

Why does S(b)=S(b̂)+Sₓₓ(b−b̂)² have its minimum at b̂ when Sₓₓ>0?

풀이와 확인할 이유Solution and explanation

제곱은 0 이상이고 b=b̂에서만 추가항이 0이기 때문이다. 이 유한 자료의 최소성만 보이며 인과성까지 증명하지 않는다.

The added term is nonnegative and vanishes at b̂. This is finite-sample minimization, not a causal proof.

자료와 출처Data and sources

Horst, Hill & Gorman (2020), palmerpenguins · Gorman, Williams & Fraser (2014) · CC0 · 2007–2009

BIS Residential property prices · 한국 명목 부동산가격 장기 연결계열 · 1980-Q1–2024-Q4 · 2010년 평균=100Korean nominal linked property-price series · 1980 Q1–2024 Q4 · 2010 average=100

자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.

자료사전·출처·이용 조건Data dictionary, sources and terms