美文网首页
Polynomial Curve Fitting 多项式曲线拟合

Polynomial Curve Fitting 多项式曲线拟合

作者: Eric_dsc | 来源:发表于2020-03-02 22:23 被阅读0次

转自:边翻译边学习_模式识别和机器学习(2)

We begin by introducing a simple regression problem,

我们以一个简单的回归问题开始

。。。

Suppose we observe a real-valued input variable x and we wish to use this observation to predict the value of a real-valued target variable t.

设想我们观察一个实数变量作为输入变量 x,我们希望用这个x去预测目标变量t的值。

The data for this example is generated from the function sin(2πx) with random    noise included in the target values。

数据样例生成自函数sin(2πx),并且加一些随机噪声到目标值中。

Now suppose that we are given a training set comprising N observations of x, written x ≡ (x1,...,xN)T, together with corresponding observations of the values of t, denoted t≡(t1,...,tN)T.

现在设想给定了一个训练集,这个训练集由N个观察值x组成,记为 x=(x1,x2...,xN)T,对应的,有一组观察值t,记为:t=(t1,...,tN)T.

Figure 1.2 shows a plot of a training set comprising N = 10data points. The input data set x in Figure 1.2 was generated by choosing values of xn, for n =1,...,N, spaced uniformly in range [0,1], and the target data set t was obtained by first computing the corresponding values of the function sin(2πx) and then adding a small level of random noise having a Gaussian distribution (the Gaussian distribution is discussed in Section 1.2.4) to each such point in order to obtain the corresponding value tn.

图1.2展示了一个10个数据的训练集的图表。输入数据x(横轴)是从[0,1]的区间中选取的;目标数据集t(纵轴)是由函数sin(2πx)加上一个随机噪声生成的。随机噪声是一个高斯(正态)分布的随机变量。

Our goal is to exploit this training set in order to make predictions of the value t of the target variable for some new value x of the input variable. As we shall see later, this involves implicitly trying to discover the underlying function sin(2πx). This is intrinsically a difficult problem as we have to generalize from a finite data set. Furthermore the observed data are corrupted with noise, and so for a given x there is uncertainty as to the appropriate value for t.

我们的目标是利用这个训练集对新的输入预测目标值。后面会涉及到挖掘这个潜在的函数sin(2πx)。但这是有一个本质的难度,因为我们必须从一个有限的数据集中泛化出来。还有就是被观察数据还有噪音的干扰。最后还有困难就是,一个给定的值x找到一个合适值t还存在不确定性。

For the moment, however, we shall proceed rather informally and consider a simple approach based on curve fitting. In particular, we shall fit the data using a polynomial function of the form

但是现在我们会使用曲线拟合这个不太正式,一个简单方法。在这里,我们拟合一个多项式函数,如下:

where M is the order of the polynomial, and xj denotes x raised to the power of j. The polynomial coefficients w0,...,wM are collectively denoted by the vector w. Note that, although the polynomial function y(x,w) is a nonlinear function of x, it is a linear function of the coefficients w. Functions, such as the polynomial, which are linear in the unknown parameters have important properties and are called linear model。

其中,M是多项式的阶,xj表示x的j次幂。这个多项式系数w0,...,wM表示为矩阵w。注意,尽管多项式函数y(x,w)是非线性的关于x的函数,却是一个关于系数矩阵w的线性函数。函数,例如这个多项式,未知参数的多项式,有重要的性质,叫做线性模型。

The values of the coefficients will be determined by fitting the polynomial to the training data. This can be done by minimizing an error function that measures the misfit between the function y(x,w), for any given value of w, and the training set data points. One simple choice of error function, which is widely used, is given by the sum of the squares of the errors between the predictions y(xn,w) for each data point xn and the corresponding target values tn, so that we minimize

系数的值会由训练数据和多项式的拟合来决定。这个可以由最小化错误函数来实现。这个可以度量函数y(x,w)和给定的系数w值的差距。一个简单的被广泛使用的错误函数是:预测值y(xn,w)和相应的目标值tn的差距的平方和,以便我们最小化。公式中的1/2的常量后面介绍。

For the moment we simply note that it is a nonnegative quantity that would be zero if, and only if, the function y(x,w) were to pass exactly through each training data point。

现在我们只简单的关注,这个错误函数值为零,当且仅当,每一个训练数据为y(x,w)的输入时。

We can solve the curve fitting problem by choosing the value of w for which E(w) is as small as possible. Because the error function is a quadratic function of the coefficients w, its derivatives with respect to the coefficients will be linear in the elements of w, and so the minimization of the error function has a unique solution, denoted by w*, which can be found in closed form. The resulting polynomial is given by the function y(x,w*).

我们可以选择一个值,使得E(w)的值最小,来解决曲线拟合问题。因为这个错误函数是系数w的二次函数,但对系数矩阵w的导数对每个系数都是线性的,并且这个错误函数的最小化有唯一值,记为w*,最终,多项式由求解出的函数y(x,w*)推导出来。

相关文章

网友评论

      本文标题:Polynomial Curve Fitting 多项式曲线拟合

      本文链接:https://www.haomeiwen.com/subject/woybkhtx.html