摘要: What is ecometrics ? Ecometrics is the use of statistical method to analysis economic data.Typically analyze nonexperimental data. Nonexperimental dat 阅读全文
posted @ 2022-09-13 23:05 |Simon| 阅读(105) 评论(0) 推荐(0)
摘要: sklearn中的决策树(1)—— 分类树¶ DecisionTreeClassifier¶ 重要参数¶ Criterion: 不纯度,gini & entropy entropy对不纯度更加敏感,即对不纯度的惩罚更强,由于这种特性,决策树的生长会更加“精细”,对高维数据很容易过拟合 实例: 红酒数 阅读全文
posted @ 2022-08-27 17:01 |Simon| 阅读(160) 评论(0) 推荐(0)
摘要: Matplotlib Learning Examples Real world examples¶ Load Necessary Libraries¶ In [3]: import numpy as np import pandas as pd import matplotlib.pyplot as 阅读全文
posted @ 2022-08-26 11:40 |Simon| 阅读(99) 评论(0) 推荐(0)
摘要: Matplotlib Learning Basics Load Necessary Libraries¶ In [4]: import matplotlib.pyplot as plt import numpy as np import pandas as pd Basic Graph¶ In [8 阅读全文
posted @ 2022-08-26 11:38 |Simon| 阅读(95) 评论(0) 推荐(0)
摘要: #定性变量写入C()中,reference表示参照水平 lm = ols("wt ~ mpg + C(vs,Treatment(reference=0))").df).fit() lm.summary() # 还可以对因变量进行非线性变化 lm = ols("np.log(wt) ~ mpg + C 阅读全文
posted @ 2022-08-22 09:56 |Simon| 阅读(82) 评论(0) 推荐(0)
摘要: 众所周知,ols线性回归模型有一些基本假定。对残差e有以下性质 E(e) = 0 ;Var(e) = σ2(I-H) 要服从正态分布 且第i 个残差的方差为: 称: 为标准化残差 如果画出残差图发现残差有问题就需要改进模型 误方差齐性诊断的方法: 如果在每个实验条件下进行重复试验,可采用:Ho = 阅读全文
posted @ 2022-08-19 00:00 |Simon| 阅读(226) 评论(0) 推荐(0)
摘要: 模型的解释变量之间存在线性关系 若中心化之后自变量的相关系数矩阵 R = X'X 接近于退化就存在多重共线性 R有多少个特征根接近于零,设计矩阵X就有多少个多重共线性关系 此时,虽然最小二乘估计β仍为线性无偏估计,但是从均方误差来看这个估计不好 可以看出,当λ很小时β的MSE和Var都会变得很大,所 阅读全文
posted @ 2022-08-16 23:01 |Simon| 阅读(420) 评论(1) 推荐(0)
摘要: 其他描述性统计量 #方差 np.var(df["wt"]) #标准差 np.std(df["wt"]) #众数 stats.mode(df["wt"]) #偏度 stats.skew(df["wt"]) #峰度 stats.kurtosis(df["wt"]) #正态分布假设下 se = np.st 阅读全文
posted @ 2022-08-14 11:00 |Simon| 阅读(235) 评论(0) 推荐(0)
摘要: 导入库 import numpy as np import pandas as pd pip install pandas plotnine #我直接install plotnine报错,不是很懂 import plotnine as pn #统计分析工具 from plotnine import 阅读全文
posted @ 2022-08-13 10:26 |Simon| 阅读(655) 评论(0) 推荐(0)