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

\[ z_t = \alpha_0 + \alpha_1 z_{t-1} + \varepsilon_t\]

where \(\alpha_0=1\), \(\alpha_1=.5\) and the variance of \(\varepsilon_t\) is \(\sigma^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 \(\times 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