2
$\begingroup$

One of my homework problems is a simulation that compares three estimators (least squares, ridge regression with known parameters, and ridge regression with estimated parameters) for the following model $$Y_i = \beta X_i + \epsilon_i,\quad \epsilon_i\sim N(0,\sigma^2)$$

I am supposed to do 1000 replications with $X_i\sim N(0,2)$. Initially I generated my $X$ vector of data and used the same $X$ vector for each of the 1000 repetitions (so only thing different between repetitions is what random error gets added on).

Then I thought that might be wrong and that I should generate new $X$ data between each repetition.

What is the correct thing to do?

I can provide code if need be, but not really necessary to answer my question.

$\endgroup$
2
$\begingroup$

I think it makes sense to change X between iterations. But within an iteration you should have the same X to compare the three estimators.

You want to compare the three estimators in general. If you keep X constant, it could happen that an estimator that is not better in general performs better, because that particular X you chose turned out to have some special property.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.