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.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
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
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme