Part 1
Contents
Part 1¶
In this part you will simulate a sample of 4 observations from a stationary AR(1) process with , ¶
# TODO
# import numpy
Generate a gen = np.random.default_rng(100)
# TODO
#eps = ...
Using
Hint: see here
Using a for
loop, generate the remaining 3 realizations of
# TODO
#for ....
As discussed in a lecture (see again here) there is a linear relationship between
Build the
# TODO
#A =
#np.testing.assert_array_almost_equal(z, A @ eps)
An alternative (and perhaps simpler) way to represent the linear relationship between
Using pen and paper, confirm for yourself that this relationship indeed holds. Then, build the matrix
Hint: check the documentation of Numpy for a function that returns the rank of a matrix. Use an assertion to confirm that
# TODO
#B =
# assert full rank...
Verify that the equality
# TODO
#np.testing.assert_array_almost_equal(...)