최소제곱법에 의한 수학적 모형 관련된 내용 최소제곱해 y=f(x)를 따르는 데이터에 대해 생각해 봅니다. $$(x_1, y_2),\, (x_2, y_2), \, \cdot, \, (x_n, y_n)$$ 위 데이터의 패턴을 찾는 것은 f(x)의 함수를 찾는 것과 같습니다. 이러한 함수를 수학적 모형이라 합니다. 이러한 함수의 몇가지 예를 나타내면 다음과 같습니다. 직선: y=ax+b 2차 다항식: y=a+bx+cx 2 3차 다항식: y=a+bx+cx 2 +dx 3 x1=symbols("x1") f=2+3*x1+4*x1**2+5*x1**3 df=f.diff(x1) ddf=df.diff(x1) x=np.linspace(-10, 10, 100) y1=[f.subs(x1, i) for i in x] y2=[df.subs(x1, i) for i in x] y3=[ddf.subs(x1, i) for i in x] fig, ax=plt.subplots(figsize=(4,3)) ax.plot(x, y1, color="r", label=r"$y=dx^{3} + cx^{2} + b x + a$") ax.plot(x, y2, color="b", label=r"$y=c x^{2} + b x + a$") ax.plot(x, y3, color="g", label=r"$y=b x + a$") ax.legend( bbox_to_anchor=(0.8,1)) ax.set_xlabel("x", loc="right") ax.set_ylabel("y", loc="top") ax.set_ylim(-200, 200) ax.spines['left'].set_position(("data", 0)) ax.spines['bottom...
python 언어를 적용하여 통계(statistics)와 미적분(Calculus), 선형대수학(Linear Algebra)을 소개합니다. 이 과정에서 빅데이터를 다루기 위해 pytorch를 적용합니다.