Create statsmodels回归分析

pull/2/head
benjas 4 years ago
parent e420f5bf76
commit 49506889a5

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1131,3 +1131,42 @@ x' = 1/x 代入
- VIFi越大,特别是大于等于10说明解释变呈xi与方程中其他解释变量之间有严重的多重共线性 - VIFi越大,特别是大于等于10说明解释变呈xi与方程中其他解释变量之间有严重的多重共线性
- VIFi越接近1表明解释变量xi和其他解释变量之间的多重共线性越弱 - VIFi越接近1表明解释变量xi和其他解释变量之间的多重共线性越弱
#### Python工具包
统计分析库https://www.statsmodels.org/stable/index
> anaconda自带
专门机器学习的包https://scikit-learn.org/stable/
> anaconda自带含大量模型和分析工具等
https://scikit-learn.org/stable/auto_examples/
> 在这里,你可以随意选择你想要的图,复制代码换成自己的即可,无需再自己写代码
还有pandas和numpy是必不可少的
#### statsmodels回归分析
~~~python
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
nsample = 20 #生成20个样本点
x = np.linspace(0, 10, nsample) # 从0-10之间生成20个数
print(x)
~~~
Out:
~~~
[ 0. 0.52631579 1.05263158 1.57894737 2.10526316 2.63157895
3.15789474 3.68421053 4.21052632 4.73684211 5.26315789 5.78947368
6.31578947 6.84210526 7.36842105 7.89473684 8.42105263 8.94736842
9.47368421 10. ]
~~~

Loading…
Cancel
Save