讲解:RAD、R, Matlab/C++、RR|R

Homework #2Due to Oct 23, 2019No.1 The air data set contains the measures of ozone (OZ), solar radiation (RAD), temperature (TEMP)and wind speed (WIND) for 111 consecutive days in a city of the state of New York. The four columns areOZ, RAD, TEMP and WIND. Consider the nonparametric modelYi = θ(Xi) + εi,where Y = OZ, X = W IND, εi v N(0, σ2)1. Fit a linear model and a quadratic model of OZ on WIND and compare the parametric fits with anonparametric fit using the kernel method. Comment on your results.2. Use the R functions ksmooth to estimate θ(t). Try a few bandwidths and a few kernel functions andexamine how the kernel estimator of θ(t) is affected by the bandwidth h and the kernel function K(u).3. Use the R functions ksmooth, loess.smooth (loess) and supsmu to estimate θ(t) and compare their fits.Use the loess function to calculat代写RAD、代做R, Matlab/C++编程语言、代写R设e the 95% confidence interval of ˆθ(t).4. Write a function using your favorite programming language, e.g., R, Matlab or C , to construct a locallinear kernel estimate of θ(t) using the Epanechnikov kernel with bandwidth h = 5. The Epanechnikovkernel is defined asK(u) = 34(1 − x2)I(|x| The Epanechnikov kernel is optimal in the sense that it minimizes the integrated MSE. Estimate the SEof ˆθ(x; h) and implement it. For simplicity, you can estimate σ2 using ˆσ2 = n−1 Pni=1{Yi − ˆθ(Xi)}.No.2 Generate data set (xi, yi), i = 1, · · · , 400, where xiis a 30 × 1 vector, yi = xi1 − 1.5xi3 + 0.8xi11 + εi.1. Forget the real relation between xi and yi. Give the OLS estimator basing on data (xi, yi), i = 1, · · · , 400.2. Using R package glmnet to implement LASSO to get a sparsity estimator. (Simulated the data NS =200)转自:http://www.3daixie.com/contents/11/3444.html

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容