这个作业是用R语言对经济问题进行线性回归建模

EBC 2043

Introduction to Software in Econometrics1样本外模型比较
对于本主题,对于观察值i = 1,请考虑具有k个解释变量的单变量线性回归模型。 。 。 ,N,
yi =Xiβ+εi

哪里
是(标量)因变量,Xi是解释变量的1×k向量,
i
iid〜N(0,σ2
)是误差,β是系数的k×1向量。
目的是为模型参数β和/或σ考虑不同的先验
2

根据样本外(预测)性能评估哪个先验会导致更好的结果。
注意:团队成员需要选择不同的数据集。
◦选择一个数据集,并应用具有多个解释变量的线性回归。
◦为模型选择两个不同的先验。解释选择背后的直觉
这些先验。
◦将数据拆分为估计和保留样本。
◦用两个先验估计线性回归模型。请注意,您可能需要
调整采样算法以适应不同的先验条件。清楚说明哪个采样
您使用的算法及其实现方式。
◦获得保留样本数据点的预测。
◦将样本外结果与不同先验结果进行比较。哪个先验会更好
样本外结果?在更好地工作之前,请解释此特定原因的原因
比其他的还要说明您用来比较样本外的度量
结果。
2贝叶斯LASSO应用
许多经济和统计应用都具有高维度,即
与数据点数量相比,参数太多,无法估算。那里
是一个大型文献(频率论者和贝叶斯论者),旨在减小
参数空间。最常见的方法是使用LASSO估算器。
对于本练习,请考虑线性回归模型。目的是在无信息的先验和LASSO的先验下报告参数估计。
◦选择适合线性回归模型的数据,并至少提供3个解释性数据
变量。 (注意:组成员需要选择其他数据。)
The linear regression model is given by:
y = X β + ε,
where y is the n×1 vector of dependent variable, X is an n×K matrix of explanatory
variables and ε ∼ N (0, σ2
I), where I indicates the identity matrix. Write down the
log-likelihood of this model.
Perform the remaining analysis for two priors:
(i) p1(β, σ2
) ∝
1
σ2
, corresponding to the flat prior.
(ii) p2(β, σ2
) ∝
1
σ2 ×
QK
k=1
λ
2

σ2
e
−λ|βk|/

σ2
◦ Create two functions to calculate the (log-)prior density for the above priors.
◦ Apply the Importance Sampling or Metropolis Hastings algorithm to obtain posterior results for the two priors separately. Clearly explain the candidate distribution
you choose.
◦ Compare the posterior results of β, σ2 obtained under the two priors. Consider
reporting the posterior means, variances or quantiles of interest.
◦ What do you conclude in terms of the relation between X and y variables? Does
the LASSO prior indeed shrink the parameter estimates?
◦ Plot the parameter draws for the elements of β. Comment on the convergence of
your simulation algorithm in both cases. Do you need to trim these draws? Do you
need to ‘burn-in’ part of the draws?
◦ How does the choice of λ effect your results?
References
Park, Trevor, and Casella, George (2008). The Bayesian LASSO. Journal of the American
Statistical Association 103, 681-686.


EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!

E-mail: easydue@outlook.com  微信:easydue


EasyDue™是一个服务全球中国留学生的专业代写公司
专注提供稳定可靠的北美、澳洲、英国代写服务
专注提供CS、统计、金融、经济、数学等覆盖100+专业的作业代写服务