APP下载

多元线性回归统计模型在房价预测中的应用

2021-07-20罗博炜洪智勇王劲屹

计算机时代 2021年6期

罗博炜 洪智勇 王劲屹

摘  要: 以多元线性回归统计模型为基础,用Python语言对美国部分地区房价数据进行建模预测,进而探究提高多元回归线性模型精度的方法。先对数据进行探索性预处理,随后设置虚拟变量并建模得出预测结果,再使用方差膨胀因子对多重共线性进行修正,从而提高模型精度与稳健性,使回归结果在很大程度上得到优化。

关键词: 多元线性回归; 多重共线性; 虚拟变量; 方差膨胀因子

中图分类号:TP3-05          文献标识码:A     文章编号:1006-8228(2020)06-51-04

Abstract: Based on the multiple linear regression statistical model, this paper built the model to predict the house price by utilizing some parts of the United States data, and then explores methods to improve the accuracy of the multiple linear regression model. Firstly, the data were preprocessed, and then the dummy variables were set up for modeling to obtain the predicted results. After that, the multicollinearity was modified by variance inflation factor so that the accuracy as well as robustness of the model was improved, and the regression results were optimized largely.

Key words: multiple linear regression; multicollinearity; dummy variable; variance inflation factor

0 引言

多元线性回归具有非常广泛的应用范围,但在实际预测中对存在类别变量设置不充分或多重共线性问题,导致统计模型缺乏精度和稳健性。由此,本文对如何精准且高效的排除多重共线性影响,并合理地将分类变量转化为虚拟变量,提升多元线性回归模型精度作了进一步探索,并将其应用于房价预测上。

1 多元线性回归模型

一个因变量与两个或更多的预测变量之间的联系被称为多元相关。在这种情况下做出的预测被称为多元回归。线性关系指因变量与自变量之间存在一次方函数关系。多元线性回归模型如下:

其中y为因变量;为自变量;β0,β1,β2,…,βm-1是m个未知参数;ε是均值为零,方差为σ2>0的不可观测的随机变量,稱为误差项,并通常假定ε~N(0,σ2)。

多元回归模型初步建立后,是否真正解释了预测变量和因变量的关系,还要进行显著性检验。

1.1 回归方程的拟合优度检验

判定指数R2描述了由自变量的线性函数值所能反应的Y的总变化量比例。结……

登录APP查看全文