第二章简单线性回归讲解.ppt
文本预览下载声明
回归系数的Monte Carlo模拟(R) x-c(9.7,10.1,10.0,10.4,10.1,10.2,9.7,10.4,9.6,9.8) b1-numeric(2000) set.seed(20) for(i in 1:2000){ y-2+5*x+rnorm(10,0,5) b1[i]-coef(lm(y~x))[[2]]} hist(b1) mean(b1);sd(b1) sqrt(25/sum((x-mean(x))^2))# require(tseries) jarque.bera.test(b1)#正态性检验 回归系数的Monte Carlo模拟(Gretl) nulldata 10 set seed 2012 loop 2000 --progressive --quiet series x={9.7,10.1,10.0,10.4,10.1,10.2,9.7,10.4,9.6,9.8} genr y1 = 2 + 5*x + 5*normal() ols y1 const x genr b2 = $coeff(x) print b2 store d:\coeff.gdt b2 endloop open d:\coeff.gdt normtest b2 --jbera 教材案例分析程序 create P38 a 1980 1998 read D:\Econometrics15\zdata\P38.xls 2 equation eq1.ls y c x show eq1 pagestruct(end=@last+2) * expand 1980 2000 x(20)=1763 x(21)=1863 eq1.forecast yf y_se plot y yf genr ypl=yf(19)-@qtdist(0.975,17)*y_se(19) genr ypu=yf(19)+@qtdist(0.975,17)*y_se(19) genr ycu=yf(19)+@qtdist(0.975,17)*@sqrt(y_se(19)^2-@se^2) genr ycl=yf(19)-@qtdist(0.975,17)*@sqrt(y_se(19)^2-@se^2) show @coefs(2) show @stderr(2) genr beta1l=@coefs(2)-@qtdist(0.975,17)*@stderr(2) genr beta1u=@coefs(2)+@qtdist(0.975,17)*@stderr(2) group P38 yf ypl ypu ycl ycu show P38 作业 P.42 6 * * * OLS估计的特性 OLS估计的特性 OLS估计量是最优线性无偏估计量(BLUE) 该特性也称为高斯-马尔科夫定理 Best, Linear, Unbiased, Estimator 一致性是指随着样本容量趋于无穷,估计量值接近真实值。 OLS估计量具有无偏性、有效性和一致性 线性 都是关于Y的线性函数 无偏性 注: 因此 有效性 估计量 的方差 协方差 有效性 满足高斯马尔柯夫条件时,OLS估计是最优线性无偏的 (Best Linear Unbiased Estimator, BLUE) 高斯-马尔柯夫条件 有效性 预测 预测 建立模型的主要目的之一是为了预测。 1)、点预测 平均值 个别值 为个别值预测误差 预测(续) 2)、预测的置信区间 均值预测的置信区间 个别值预测的置信区间 注:离开 越远的估计(或预测),其结果也就越不 可靠。 置信区间、预测区间、回归方程 Y X 预测上限 置信上限 预测下限 置信下限 预测评价 均方误的平方根 (RMSE,root mean squared error) 平均绝对值误差 (MAE,mean absolute error) 西尔不相等系数 (Theil’s inequality coefficient) 是预测期数 值在0,1之间,等于1则说明模型预测能力最差 模型应用及相关软件操作 案例分析 估计保健支出和收入之间的关系。 数据data22.xls Eviews操作简介 界面 数据输入(键盘输入) File New Workfile Object New object File Open Foreign Data as Workfile... 出现下面的界面,找到相应数据文件后点击打 开。 数据输入(外部文件) 数据输入(结果) 作散点图 Quick Graph Scatter出现下图界面,中间 填入变量income exphlth即可,注意顺序! 作散点图(续) 显
显示全部