You use a subset (see below) of the dataset in the file “HousePrices.txt” which consist of 11columns, with measurements for each of 585 Belgian municipalities. The response variable is themedian price of a regular house in the municipality (in thousands of euros).Region x1 The administrative region: Flanders, Walloon, Brussels-capital.Province x2 The name of the province (there are officially 10 provinces in Belgium), plus theBrussels-capital region, which is here treated as a separate province. Hence this variable has 11categories.Municipality The name of the municipality (this identifies the different observations and isprovided just for the curious ones).PriceHouse y Median price of a regular house in the municipality (in thousands of euros).Shops x3 The number of officially registered shops in the municipality exceeding a certainnumber of square meters.Bankruptcies x4 Number of bankruptcies in the municipality in one year, this includes all type ofenterprises (from one-person companies to big firms).MeanIncome x5 The average of the taxable incomes of all tax forms of the municipality (inthousands of euros).TaxForms x6 The number of tax declarations for the municipality that were submitted to the taxoffice.HotelRestaurant x7 The number of hotels and restaurants (added together) in the municipality.Industries x8 Number of industrial firms in the municipality.HealthSocial x9 The number of health care and social service facilities in the municipality.Each of you will study a subset of these data, and use the following code to get your sub-dataset.Note that the provided code serves as a hint, you will need to make changes to it.Constructing your own dataset:code = 753031fulldata = read.csv(HousePrices.txt, sep = , header = TRUE)digitsum = function(x) sum(floor(x/10^(0:(nchar(x)-1)))%%10)set.seed(code)mysum = digitsum(code)if((mysum %% 2) == 0) { # number is evenrownumbers = sample(1:327,150,replace=F)} else { # number is oddrownumbers = sample(309:585,150,replace=F)}mydata = fulldata[rownumbers,]This way you have taken a sample of 150 municipalities, either from the Flanders region +Brussels captial area, or from the Walloon region + Brussels captial area. Now, based on your ownsub-dataset, answer following questions one by one.Questions to be answered:1) Q1: Use semiparametric flexible modelling to construct a model for the median house price.Use AIC as a method to select a final model and report on which (type of) models wereincluded in the search. Only for the components of the selected model that are modeled in anonlinear way, provide graphs. The models in this question should not treat covariates asrandom effects. Give the model that you have selected in correct notation. It is alright to usea general notation (e.g. f(x2)) for a smooth function, but you have to state which (spline)functions you have used, and how the smoothing parameter was selected. If you want touse the function gam from library(mgcv), the provided AIC value is compatible withparametric AIC values when using the default option for setting the smoothing parameter.Notes for Q1:a) explore all variables of “mydata”, state the information of “distribution” and “link function”clearly in the models.b) Clearly state how many (and why) knots you choose, and clarify how you choosesmoothing parameter in details.c) Treat all variables as fixed.2) For this question you use the response and only the covariates x6 (number of tax forms) andx9 (number of health care and social service facilities). State the null hypothesis of aparametric additive model for the median house price with quadratic effects for bothcovariates. Test this hypothesis using an order selection test against a nonparametricalternative hypothesis, report the hypotheses, the construction of the test statistic, its value,as well as the corresponding p-value and draw the correct conclusion.Notes for Q2:a) Test whether you can fit an additive model in those two covariates (x6 and x9) in quadraticeffects.b) Clearly state how to do a proper test, including all steps of hypothesis testing and howthey lead to the conclusion?3) In this question a parametric (generalized) linear mixed effect model should be constructed.(i) Make a graphical presentation that supports why you suggest a certain mixed effect structureusing x2 Province as the grouping variable. Construct the plot illustrating whether there is aneffect of Province when regressing y on x6 the number of tax forms. For the plot you mayignore all other covariates.(ii) Construct a parametric (generalized) linear mixed effect model using your suggestion from (i).You leave out variable x1 for this part, other covariates may be included in the model in a parametric way. Your model should include x2 and x6, the inclusion of other covariates inyour model may be based on your answer of question 1, no fixed effect model selectionshould be done for this question. Provide the model using correct notation, and give asummary of the output. Briefly discuss whether the output supports your suggestion from (i).Note: library(hglm) contains both hglm and hglm2 wich may be used for fitting, alsoglmm-PQL is a possibility. If one of these functions gives problems for your dataset, try one ofthe other ones.Notes for Q3:a) Among Q1-5, only Q3 takes the random effect into consideration.4) In this question you start from a large parametric model (no random effects, no interactions)and you will perform a focused search over all sub-models of the large model and this fortwo focuses:(i) the median price of a regular house for one municipality of your choice from yourdataset where there is a low (though not the lowest) number of industrial firms,(ii) the median price of a regular house for one municipality of your choice from yourdataset where there is a large (though not the largest) number of hotels and restaurants.Write the selected model for each focus using correct notation and provide theestimated values of the focuses for both cases. Briefly discuss.Notes for Q4:a) Look your dataset in 150 lines, pick one village for the low industry, and another one forthe high number of hotels. And, search for the best models to match the house price forthose two villages.b) Use correct notations and clearly state the “distribution”, “link function”, “coefficient”.5) In this question you use the same large parametric model (no random effects, no interactions)as you started with in question 4.(i) Construct a table containing the vector of estimated coefficients of the regression modelusing four methods:(a) maximum likelihood estimation in the large model(b) Ridge regression(c) Lasso estimation(d) An elastic net estimator, different from the ridge and lasso one.For (b), (c) and (d) you use the software’s default value for the penalty parameter λ.(ii) Using the four estimation methods from (i), give in a table the predictions for the medianprice of a regular house for the same two municipalities as in question 4. Briefly discuss.Note: If you would like to use a function other than glmnet for penalized estimation, here is analternative with a few more options. Since the syntax is quite a bit different, you might want toadjust the lines below to your setting, if you want to use this.library(h2o)h2o.init()mydat2=as.h2o(mydata)mydat2$Region mydat2$Province y=PriceHouseX = c(Province, Shops) # add here the variables that you wish to put in X.alpha0 lambda_search=TRUE, training_frame=mydat2, nfolds=0)# indicate the same rows as in question 4:Xeval = as.h2o(as.data.frame(mydat2[c(1,2),]))h2o.predict(alpha0, newdata=Xeval)本团队核心人员组成主要包括BAT一线工程师，精通德英语！我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域：window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业，所以值得信赖。如有需要，请加QQ：99515681 或邮箱：99515681@qq.com 微信：codehelp QQ：99515681 或邮箱：99515681@qq.com 微信：codehelp

你或许想：《去原作者写文章的地方》