최소 자승 회귀법은 간단한 함수의 근사부터 잡음이 있거나 정렬되지 않은 함수의 근사까지 다양하게 응용할
수 있다. 이 방법은
1
차원 함수뿐만 아니라 다차원 함수에도 적용 가능하다. 어디에 응용하든 기저에 깔린 수학
적 방법론은 거의 동일하다.
11.1.2
보간법
회귀법과 달리
보간법
interpolation
은 수학적으로 훨씬 더 복잡하고 다차원에 적용하기 어렵다. 보
간법은
x
차원의 정렬된 관측점이 주어졌을 때 두 개의 이웃하는 관측점 사이의 자료를 계산하
는 보간 함수를 만드는 것이다. 보간 함수는 관측점 자체도 정확하게 재현해야 하고 각 관측점
에서 연속 미분 가능한 함수
continuously
differentiable
function
여야 한다. 연속 미분 가능하기 위해서는
보간 함수가 최소
3
차 이상, 즉 큐빅 스플라인 함수
cubic
spline
function
여야 한다. 그러나 이 방법론
자체는
2
차 보간 함수나
1
차 선형 보간 함수의 경우에도 적용 가능하다. 다음 코드는 선형 스
플라인 보간을 구현한 것이다. 결과는 [그림
11
-
11
]에 그렸다.
398
3
부
금융 데이터 과학
In [45]: import scipy.interpolate as spi
➊
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.