Great job, and good examples.
A couple of modifications that could be implemented.
Let there be one input, the order of the denominator, and accept an array. Calculate rms error and return that for the array. Could either set the numerator to the denominator, or sweep the numerator from 2 to the order of the denominator.
Incorporate a lag term, including raising the exponent to a power.
In your examples, you may want to include extracting the polynomial from a psd, generating a time history from a filter on rand, and replotting the resulting psd for comparison.