Question: Question 1 The data frame nlmodel contains data on a response variable y and a single explanatory variable x. A scatter plot of y versus
Question 1 The data frame nlmodel contains data on a response variable y and a single explanatory variable x. A scatter plot of y versus x suggests a strong non-linear relationship:
Suppose for these data we wish to consider the model
Yi N ( 1xi 2 + xi , 2 )
i = 1, 2, . . . , 100, Yi independent
(a) [1 mark] Why cant this model be fit using a linear (regression) model?
(b) [2 marks] Write down the likelihood L(1, 2, 2 ; y, x) and the log-likelihood `(1, 2, 2 ; y, x)
(c) [1 mark] Write an R function mylike() which evaluates the negative log-likelihood (i.e. `(1, 2, ; y, x)) for any values of the three parameters. (d) [3 marks] Use the R function nlm() in association with your function mylike() to numerically minimise the log-likelihood and report the maximum likelihood estimates for the model parameters. Provide some evidence of how you chose sensible starting values. (e) [2 marks] Estimate the standard errors and construct 99% confidence intervals for 1 and 2. (f) [2 marks] Test the hypothesis that 2 = 0.08 at the 10% significance level (not using the confidence interval). (g) [4 marks] Produce a plot of the associated mean relationship and the associated 95% prediction intervals on a scatter plot of y versus x. Comment on the appropriateness of the model
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
