HW 5 part 1

HW 5 part 1

Import what is needed here (first read what follows)

# import ...

Set gen = np.random.default_rng(seed), with the seed assigned to you.

#TODO

Simulate n_rep=500 samples of n_obs=100 observations from a AR(1) process

zt=α0+α1zt1+εt

where α0=1, α1=.5 and the variance of εt is σ2=1.5

# TODO

# data = 

Estimate the correct model specification using OLS and MLE for each one of the n_rep samples and save the parameter estimates from each method in two n_rep ×3 arrays, called thetaOLS (for OLS) and thetaMLE (for MLE)

Hint: Probably want to use a for loop…

## TODO

Print the means and standard deviations of the parameter estimates

#TODO

Compute and print the biases and mean squared errors of the parameter estimates

#TODO

Plot in a 2x3 figure the histograms of the parameter estimates, with OLS on the top row and MLE in the bottom

#TODO

Comment briefly on the relative performance of OLS and MLE for this model