Data formatting and plot AR model

Please read the pinned thread and format the code properly so that we can read it properly, then show a complete error message so that we can properly understand the context of the error. Copy and paste, starting from the line that says Traceback (most recent call last): until the end, and format it the same way as the code.