Mathemagical Statistics – MATH 2606
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Mathemagical Statistics – MATH 2606
2022
Problem IX.1. (Weighted bootstrap.)
(a) Suppose we observe (yi , xi ) for i = 1, . . . , N to which we associate wi , the weight of each observation. Assume the linear model : yi = a . xi + b + ci . but also assume that the squared loss function is weighted by each wi , i.e.
N
SS(a, b) = wi ci(2) .
i=0
Derive an expression for the weighted line of best fit.
(b) Using the country_data.txt data set, plot the life expectancy log0+(GDP) together
with the weighted line of best fit with the following requirements: label your axes appro- priately, color the data as grey, closed cirlces, and color the regression line in red.
(c) Design a bootstrap procedure to construct a distribution for your weighted least squares estimates. Use at least 1,000 iterations.
(d) Construct a 99% confidence interval for the life expectancy when a country has a GDP
per capita of $3000.
Problem IX.2. (Odds are.)
(a) Consider the data set found in logistic.csv. Plot the data set with closed, grey
squares and appropriately labeled axes.
(b) The logistic model has that
yi ~ BERNOULLI(pi ),
where pi = b( . Write down the log-likelihood for this data set and construct a function that calculates for a specified a, b, x, and y .
(c) Construct a function that performs a stochastic search for the MLE of a and b .
(d) Construct a bootstrap procedure to estimate the distirbution of (MLE , MLE ). Use at least 1,000 iterations.
(e) The odds of an event are defined as 0p一p . The odds ratio for a logistic regression is the
ratio of odds measured when x = 1 and the odds measured when x = 0. Conduct a hypothesis test at the 99% confidence level for whether the odds ratio is equal to one.
2022-05-13