MATH 456 Homework 06
Due 2026-03-31 by 11:59pm
-
Which is a better estimator the biased or unbiased estimator for the variance? You'll attempt to answer this question in the following 3 parts.
a. Write two functions "by hand" that calculate the biased and unbiased estimate for the variance. You can use the built in R functions
meanandlength, but no other built in function.b. Pick true values for the mean and variance, say
. Generate R = 1000pairs of estimates, each pair from newN = 11randomly sampled Normally distributed data. Use the R functionrnorm(N, m, s)to generate the random data.c. For whichever value of the variance you chose, say
, calculate the mean squared error as where
is the th estimate of a variance. Calculate the mean squared error of all estimates for both the biased and unbiased estimators. d. Which estimator has lower mean squared error? Which do you think is a better property of an estiamte, lower mean squared error or unbiasedness?
-
Consider the simplified log-likelihood for linear regression with one predictor
a. Use calculus to find estimates
based on the data alone. b. Write R functions that calculate
. c. Use data to compare your solutions to what R's function
lmprovides.