1. 非线性回归
我们首先来看维基百科中对于非线性回归的定义:
In statistics, nonlinear regression is a form of regression analysis in which observational data are modeled by a function which is a nonlinear combination of the model parameters and depends on one or more independent variables.
这段话的意思是:非线性回归是采用一个函数模型对观测数据进行建模,并且该函数是由模型参数的非线性组合构成的,并且可以通过观测数据(自变量和因变量)对模型参数进行估计。
这里需要注意的是:非线性估计中的非线性指的是模型函数是由模型参数的非线性组合构成,而并不是描述函数和自变量之间的关系。
举个例子,我们采用如下的模型:
y
∼
f
(
x
,
β
)
\mathbf{y} \sim f(\mathbf{x},\mathbf{\beta})
y∼f(x,β)
其中,
x
=
{
x
1
,
x
2
,
⋯
,
x
n
}
\mathbf{x}=\{x_1,x_2,\cdots,x_n\}
x={x1,x2,⋯,xn} 为自变量向量,
y
=
{
y
1
,
y
2
,
⋯
,
y
n
}
\mathbf{y}=\{y_1,y_2,\cdots,y_n\}
y={y1,y2,⋯,yn}为观测因变量向量,
β
=
{
β
1
,
β
2
,
⋯
,
β
n
}
\mathbf{\beta}=\{\beta_1,\beta_2,\cdots,\beta_n\}
β={β1,β2,⋯,βn}为模型参数向量。
假设某个模型由一个自变量,和两个参数构成,即:
f
(
x
,
β
)
=
β
1
x
β
2
+
x
f(\mathbf{x},\mathbf{\beta})=\frac{\beta_1x}{\beta_2+x}
f(x,β)=β2+xβ1x
显然,函数模型
f
f
f无法表示成模型参数
β
1
\beta_1
β1和
β
2
\beta_2
β2的线性组合,因此,这个函数是非线性的。
2. 线性回归
如果我们考虑如下的模型:
f
(
x
,
β
)
=
β
0
+
β
1
x
1
+
β
2
x
2
2
+
⋯
+
β
n
x
n
2
f(\mathbf{x},\mathbf{\beta})=\beta_0+\beta_1x_1+\beta_2x_2^2+\cdots+\beta_nx_n^2
f(x,β)=β0+β1x1+β2x22+⋯+βnxn2
这看似是一个非线性函数,但是实际上,函数
f
f
f对于模型参数
{
β
0
,
β
1
,
⋯
,
β
n
}
\{\beta_0,\beta_1,\cdots,\beta_n\}
{β0,β1,⋯,βn}而言是线性的,即是由
{
β
0
,
β
1
,
⋯
,
β
n
}
\{\beta_0,\beta_1,\cdots,\beta_n\}
{β0,β1,⋯,βn}的线性组合构成的,系数分别为
1
,
x
1
,
x
2
,
⋯
,
x
n
1,x_1,x_2,\cdots,x_n
1,x1,x2,⋯,xn。因此,这个函数是线性的。
3. 总结
线性还是非线性是要根据分析的目标来决定的,在线性回归和非线性回归中,我们需要求解的是模型参数,因而,线性与非线性描述的是函数模型与模型参数之间的关系,而非因变量与自变量之间的关系。