logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
595 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Stefan WoodComputer science
(5/5)

666 Answers

Hire Me
expert
Dan CurnowComputer science
(5/5)

992 Answers

Hire Me
expert
Jeremy BauerrAccounting
(4/5)

867 Answers

Hire Me
expert
Gianna SimsPsychology
(5/5)

995 Answers

Hire Me
R Programming
(5/5)

Load and inspect the q1.dat data, verify it has 2 numeric variables.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Question 1

Consider a simple linear regression

Yi = β0 + β1Xi + s.

However instead of assuming the error variables s ~ ! (0, σ 2) where σ > 0, assume

si ~ Laplace(σ) where Laplace denotes the Laplace distribution which has the density,

 f (x|σ) =

 

 1 exp(−|x|/σ)

 This can lead to the likelihood model (you do not need to show this) where the log likelihood of the parameters θ = (β0, β1, σ) is given by

 G(θ|X) 

 −#,

1 n

 if σ < 0;

 { −n log(2σ) − σ Σi=1 |Yi − β0 − β1Xi |,

 otherwise.

 where X = (Y1 , … , Yn , X11, … , X1n, X21, … , X2n)

For this question consider estimating a the simple linear regression coefficients using the method of Maximum Likelihood Estimation (MLE) assuming Laplace errors instead of Gaussian errors. A dataset is provided to explore this estimation method. It is given in the rds file q1dat.rds available on canvas.

a. [3 marks] Load and inspect the q1.dat data, verify it has 2 numeric variables. Then create a scatterplot of the data.

## $ X: num 22.3 25.9 24.2 25.7 27 ...

## $ Y: num 1770 2232 2110 2048 3012 ...

b. [4 marks] Fit the linear regression using the lm function in R and extract the regression coefficients (the β values) and the estimate of σ . Add the least squares regression line to your scatterplot.

 

(5/5)
Attachments:

Expert's Answer

595 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme